Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
build: 支持完整的 async await 特性 (#147)
Browse files Browse the repository at this point in the history
resolve #140
  • Loading branch information
Darmody authored and yesmeck committed Aug 27, 2019
1 parent dab6cdc commit 0a2e310
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/remax-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@
"@meck/rollup-plugin-postcss": "^2.0.3",
"@remax/postcss-px2units": "^0.2.0",
"acorn-walk": "^7.0.0",
"babel-plugin-transform-async-to-promises": "^0.8.14",
"commander": "^2.19.0",
"ejs": "^2.6.1",
"lodash": "^4.17.11",
"regenerator-runtime": "^0.11.0",
"rollup": "^1.16.0",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-copy": "^3.1.0",
"rollup-plugin-delete": "^1.1.0",
"rollup-plugin-inject": "^3.0.1",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.0.3",
"rollup-plugin-progress": "^1.1.1",
Expand Down
11 changes: 5 additions & 6 deletions packages/remax-cli/src/build/rollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import postcss from '@meck/rollup-plugin-postcss';
import progress from 'rollup-plugin-progress';
import clean from 'rollup-plugin-delete';
import alias from 'rollup-plugin-alias';
import inject from 'rollup-plugin-inject';
import copy from 'rollup-plugin-copy';
import stub from './plugins/stub';
import pxToUnits from '@remax/postcss-px2units';
Expand Down Expand Up @@ -53,12 +54,6 @@ export default function rollupConfig(
],
};

if (adapter.name !== 'alipay') {
babelConfig.plugins.unshift(
require.resolve('babel-plugin-transform-async-to-promises')
);
}

const stubModules: string[] = [];

adapters.forEach(name => {
Expand Down Expand Up @@ -196,6 +191,10 @@ export default function rollupConfig(
return input.replace(/\.css/, '.css.js');
},
}),
inject({
exclude: 'node_modules/**',
regeneratorRuntime: 'regenerator-runtime',
}),
rename({
matchAll: true,
map: input => {
Expand Down
1 change: 1 addition & 0 deletions packages/remax-cli/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare module 'rollup-plugin-node-resolve';
declare module 'rollup-plugin-progress';
declare module 'rollup-plugin-delete';
declare module 'rollup-plugin-alias';
declare module 'rollup-plugin-inject';
declare module 'rollup-plugin-url';
declare module 'rollup-plugin-typescript';
declare module '@remax/postcss-px2units';
Expand Down

0 comments on commit 0a2e310

Please sign in to comment.