Skip to content

Commit 651d564

Browse files
committed
remove transform async to generator
1 parent 41607cf commit 651d564

File tree

2 files changed

+124
-116
lines changed

2 files changed

+124
-116
lines changed

package.json

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
11
{
2-
"name": "microbundle",
3-
"version": "0.11.0",
4-
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
5-
"main": "dist/microbundle.js",
6-
"source": "src/index.js",
7-
"bin": "dist/cli.js",
8-
"scripts": {
9-
"build": "npm run -s build:babel && npm run -s build:self",
10-
"build:babel": "babel-node src/cli.js --target=node --format cjs src/{cli,index}.js",
11-
"build:self": "node dist/cli.js --target=node --format cjs src/{cli,index}.js",
12-
"prepare": "npm run -s build",
13-
"prepare:babel": "babel src/*.js -d dist && npm t",
14-
"lint": "eslint src",
15-
"test": "npm run -s lint && npm run -s build && cross-env BABEL_ENV=test jest",
16-
"release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
17-
},
18-
"repository": "developit/microbundle",
19-
"prettier": {
20-
"singleQuote": true,
21-
"trailingComma": "all",
22-
"useTabs": true
23-
},
24-
"jest": {
25-
"testEnvironment": "node",
26-
"testURL": "http://localhost"
27-
},
28-
"husky": {
29-
"hooks": {
30-
"pre-commit": "lint-staged"
31-
}
32-
},
33-
"keywords": [
34-
"bundle",
35-
"rollup",
36-
"micro library"
37-
],
38-
"files": [
39-
"src",
40-
"dist"
41-
],
42-
"author": "Jason Miller <[email protected]> (http://jasonformat.com)",
43-
"license": "MIT",
44-
"dependencies": {
45-
"@babel/core": "^7.2.2",
46-
"@babel/plugin-proposal-class-properties": "7.2.1",
47-
"@babel/plugin-syntax-jsx": "^7.2.0",
48-
"@babel/polyfill": "^7.0.0",
49-
"asyncro": "^3.0.0",
50-
"autoprefixer": "^9.0.0",
51-
"babel-plugin-transform-async-to-promises": "^0.8.3",
52-
"babel-plugin-transform-replace-expressions": "^0.2.0",
53-
"brotli-size": "^0.0.3",
54-
"camelcase": "^5.0.0",
55-
"chalk": "^2.4.0",
56-
"cssnano": "^4.1.7",
57-
"es6-promisify": "^6.0.1",
58-
"gzip-size": "^5.0.0",
59-
"pretty-bytes": "^5.1.0",
60-
"rollup": "^0.67.3",
61-
"rollup-plugin-alias": "^1.5.1",
62-
"rollup-plugin-babel": "^4.1.0-0",
63-
"rollup-plugin-buble": "^0.19.4",
64-
"rollup-plugin-bundle-size": "^1.0.1",
65-
"rollup-plugin-commonjs": "^9.0.0",
66-
"rollup-plugin-es3": "^1.1.0",
67-
"rollup-plugin-flow": "^1.1.1",
68-
"rollup-plugin-json": "^3.1.0",
69-
"rollup-plugin-node-resolve": "^4.0.0",
70-
"rollup-plugin-postcss": "^1.6.1",
71-
"rollup-plugin-preserve-shebang": "^0.1.6",
72-
"rollup-plugin-sizes": "^0.4.2",
73-
"rollup-plugin-terser": "^3.0.0",
74-
"rollup-plugin-typescript2": "^0.19.0",
75-
"sade": "^1.4.0",
76-
"tiny-glob": "^0.2.6",
77-
"tslib": "^1.9.0",
78-
"typescript": ">=2.8.3"
79-
},
80-
"devDependencies": {
81-
"@babel/cli": "^7.2.0",
82-
"@babel/node": "^7.2.2",
83-
"@babel/preset-env": "^7.2.0",
84-
"babel-core": "^7.0.0-bridge.0",
85-
"babel-jest": "^23.6.0",
86-
"cross-env": "^5.2.0",
87-
"directory-tree": "^2.1.0",
88-
"eslint": "^5.0.0",
89-
"eslint-config-developit": "^1.1.1",
90-
"eslint-config-prettier": "^3.0.0",
91-
"eslint-plugin-prettier": "^3.0.0",
92-
"fs-extra": "^7.0.1",
93-
"husky": "^1.1.2",
94-
"jest": "^24.5.0",
95-
"lint-staged": "^8.0.0",
96-
"prettier": "^1.15.3",
97-
"regenerator-runtime": "^0.13.1",
98-
"rimraf": "^2.6.2",
99-
"shell-quote": "^1.6.1",
100-
"strip-ansi": "^5.0.0"
101-
}
2+
"name": "microbundle",
3+
"version": "0.11.0",
4+
"description": "Zero-configuration bundler for tiny JS libs, powered by Rollup.",
5+
"main": "dist/microbundle.js",
6+
"source": "src/index.js",
7+
"bin": "dist/cli.js",
8+
"scripts": {
9+
"build": "npm run -s build:babel && npm run -s build:self",
10+
"build:babel": "babel-node src/cli.js --target=node --format cjs src/{cli,index}.js",
11+
"build:self": "node dist/cli.js --target=node --format cjs src/{cli,index}.js",
12+
"prepare": "npm run -s build",
13+
"prepare:babel": "babel src/*.js -d dist && npm t",
14+
"lint": "eslint src",
15+
"test": "npm run -s lint && npm run -s build && cross-env BABEL_ENV=test jest",
16+
"release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
17+
},
18+
"repository": "developit/microbundle",
19+
"prettier": {
20+
"singleQuote": true,
21+
"trailingComma": "all",
22+
"useTabs": true
23+
},
24+
"jest": {
25+
"testEnvironment": "node",
26+
"testURL": "http://localhost"
27+
},
28+
"husky": {
29+
"hooks": {
30+
"pre-commit": "lint-staged"
31+
}
32+
},
33+
"keywords": [
34+
"bundle",
35+
"rollup",
36+
"micro library"
37+
],
38+
"files": [
39+
"src",
40+
"dist"
41+
],
42+
"author": "Jason Miller <[email protected]> (http://jasonformat.com)",
43+
"license": "MIT",
44+
"dependencies": {
45+
"@babel/core": "^7.2.2",
46+
"@babel/plugin-proposal-class-properties": "7.2.1",
47+
"@babel/plugin-syntax-jsx": "^7.2.0",
48+
"@babel/polyfill": "^7.0.0",
49+
"asyncro": "^3.0.0",
50+
"autoprefixer": "^9.0.0",
51+
"babel-plugin-transform-async-to-promises": "^0.8.3",
52+
"babel-plugin-transform-replace-expressions": "^0.2.0",
53+
"brotli-size": "^0.0.3",
54+
"camelcase": "^5.0.0",
55+
"chalk": "^2.4.0",
56+
"core-js": "2",
57+
"cssnano": "^4.1.7",
58+
"es6-promisify": "^6.0.1",
59+
"gzip-size": "^5.0.0",
60+
"pretty-bytes": "^5.1.0",
61+
"rollup": "^0.67.3",
62+
"rollup-plugin-alias": "^1.5.1",
63+
"rollup-plugin-babel": "^4.3.2",
64+
"rollup-plugin-bundle-size": "^1.0.1",
65+
"rollup-plugin-commonjs": "^9.0.0",
66+
"rollup-plugin-es3": "^1.1.0",
67+
"rollup-plugin-flow": "^1.1.1",
68+
"rollup-plugin-json": "^3.1.0",
69+
"rollup-plugin-node-resolve": "^4.0.0",
70+
"rollup-plugin-postcss": "^1.6.1",
71+
"rollup-plugin-preserve-shebang": "^0.1.6",
72+
"rollup-plugin-sizes": "^0.4.2",
73+
"rollup-plugin-terser": "^3.0.0",
74+
"rollup-plugin-typescript2": "^0.19.0",
75+
"sade": "^1.4.0",
76+
"tiny-glob": "^0.2.6",
77+
"tslib": "^1.9.0",
78+
"typescript": ">=2.8.3"
79+
},
80+
"devDependencies": {
81+
"@babel/cli": "^7.2.0",
82+
"@babel/node": "^7.2.2",
83+
"@babel/preset-env": "^7.4.2",
84+
"babel-core": "^7.0.0-bridge.0",
85+
"babel-jest": "^23.6.0",
86+
"cross-env": "^5.2.0",
87+
"directory-tree": "^2.1.0",
88+
"eslint": "^5.0.0",
89+
"eslint-config-developit": "^1.1.1",
90+
"eslint-config-prettier": "^3.0.0",
91+
"eslint-plugin-prettier": "^3.0.0",
92+
"fs-extra": "^7.0.1",
93+
"husky": "^1.1.2",
94+
"jest": "^24.5.0",
95+
"lint-staged": "^8.0.0",
96+
"prettier": "^1.15.3",
97+
"regenerator-runtime": "^0.13.1",
98+
"rimraf": "^2.6.2",
99+
"shell-quote": "^1.6.1",
100+
"strip-ansi": "^5.0.0"
101+
}
102102
}

src/index.js

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { rollup, watch } from 'rollup';
99
import commonjs from 'rollup-plugin-commonjs';
1010
import babel from 'rollup-plugin-babel';
1111
import nodeResolve from 'rollup-plugin-node-resolve';
12-
import buble from 'rollup-plugin-buble';
1312
import { terser } from 'rollup-plugin-terser';
1413
import alias from 'rollup-plugin-alias';
1514
import postcss from 'rollup-plugin-postcss';
@@ -520,15 +519,24 @@ function createConfig(options, entry, format, writeMeta) {
520519
],
521520
],
522521
}),
523-
// Only used for async await
524522
babel({
525-
// We mainly use bublé to transpile JS and only use babel to
526-
// transpile down `async/await`. To prevent conflicts with user
527-
// supplied configurations we set this option to false. Note
528-
// that we never supported using custom babel configs anyway.
529-
babelrc: false,
530523
extensions: EXTENSIONS,
531524
exclude: 'node_modules/**',
525+
presets: [
526+
[
527+
'@babel/preset-env',
528+
{
529+
loose: true,
530+
modules: false,
531+
debug: true,
532+
useBuiltIns: 'usage',
533+
corejs: 2,
534+
targets:
535+
options.target === 'node' ? { node: '6' } : undefined,
536+
exclude: ['transform-async-to-generator'],
537+
},
538+
],
539+
],
532540
plugins: [
533541
require.resolve('@babel/plugin-syntax-jsx'),
534542
[
@@ -567,15 +575,15 @@ function createConfig(options, entry, format, writeMeta) {
567575
};
568576
},
569577
},
570-
buble({
571-
exclude: 'node_modules/**',
572-
jsx: options.jsx || 'h',
573-
objectAssign: options.assign || 'Object.assign',
574-
transforms: {
575-
dangerousForOf: true,
576-
dangerousTaggedTemplateString: true,
577-
},
578-
}),
578+
// buble({
579+
// exclude: 'node_modules/**',
580+
// jsx: options.jsx || 'h',
581+
// objectAssign: options.assign || 'Object.assign',
582+
// transforms: {
583+
// dangerousForOf: true,
584+
// dangerousTaggedTemplateString: true,
585+
// },
586+
// }),
579587
// We should upstream this to rollup
580588
// format==='cjs' && replace({
581589
// [`module.exports = ${rollupName};`]: '',

0 commit comments

Comments
 (0)