diff --git a/packages/build-user-config/src/userConfig/polyfill.js b/packages/build-user-config/src/userConfig/polyfill.js index 757d2b6b53..b0422c95c9 100644 --- a/packages/build-user-config/src/userConfig/polyfill.js +++ b/packages/build-user-config/src/userConfig/polyfill.js @@ -8,9 +8,7 @@ module.exports = (config, polyfill) => { }; if (typeof polyfill === 'string') { presetEnvParam.corejs = 3; - if (polyfill === 'usage') { - injectTransformRuntime(config); - } else if (polyfill === 'entry') { + if (polyfill === 'entry') { const entries = config.toConfig().entry; const rule = config.module.rule('polyfill').test(/\.jsx?|\.tsx?$/); const fileList = []; @@ -34,7 +32,12 @@ module.exports = (config, polyfill) => { }); rule.use('polyfill-loader').loader(require.resolve('../utils/polyfillLoader')).options({}); addBablePlugins(config, [[require.resolve('../utils/babelPluginCorejsLock.js'), { fileList }]]); + } else { + injectTransformRuntime(config); } + } else if (polyfill === false) { + // inject async/await polyfill + injectTransformRuntime(config); } processPresetEnv(config, presetEnvParam); }; diff --git a/packages/plugin-rax-app/package.json b/packages/plugin-rax-app/package.json index bb1ae584a4..0f31c3a9a7 100644 --- a/packages/plugin-rax-app/package.json +++ b/packages/plugin-rax-app/package.json @@ -1,6 +1,6 @@ { "name": "build-plugin-rax-app", - "version": "6.0.0", + "version": "6.0.1", "description": "The basic webpack configuration for rax project", "author": "Rax Team", "main": "lib/index.js", diff --git a/packages/plugin-rax-app/src/config.js b/packages/plugin-rax-app/src/config.js index 495362a006..da8490cbf3 100644 --- a/packages/plugin-rax-app/src/config.js +++ b/packages/plugin-rax-app/src/config.js @@ -41,9 +41,9 @@ module.exports = [ configWebpack: require('./userConfig/inlineStyle'), validation: 'boolean' }, - { + { name: 'polyfill', - defaultValue: 'usage' + defaultValue: false }, { name: 'compileDependencies', diff --git a/packages/plugin-rax-app/src/setDev.js b/packages/plugin-rax-app/src/setDev.js index f29fe612bf..4faef75255 100644 --- a/packages/plugin-rax-app/src/setDev.js +++ b/packages/plugin-rax-app/src/setDev.js @@ -28,6 +28,7 @@ module.exports = function(api) { let webMpa = false; let weexMpa = false; let krakenMpa = false; + let isFirstCompile = true; const getWebpackEntry = (configs, configName) => { const taskConfig = configs.find((webpackConfig) => webpackConfig.name === configName); if (!taskConfig || !taskConfig.entry) { @@ -121,7 +122,8 @@ module.exports = function(api) { if (targets.includes(WEB)) { console.log(highlightPrint(' [Web] Development server at: ')); // do not open browser when restart dev - const shouldOpenBrowser = !commandArgs.disableOpen && !process.env.RESTART_DEV; + const shouldOpenBrowser = !commandArgs.disableOpen && !process.env.RESTART_DEV && isFirstCompile; + isFirstCompile = false; if (webEntryKeys.length > 0) { let openEntries = []; if (commandArgs.mpaEntry) { diff --git a/packages/plugin-rax-kraken/package.json b/packages/plugin-rax-kraken/package.json index 1a893b4559..5289df9353 100644 --- a/packages/plugin-rax-kraken/package.json +++ b/packages/plugin-rax-kraken/package.json @@ -1,6 +1,6 @@ { "name": "build-plugin-rax-kraken", - "version": "1.0.5", + "version": "1.0.6", "description": "rax kraken app plugin", "main": "lib/index.js", "scripts": { diff --git a/packages/plugin-rax-kraken/src/setEntry.js b/packages/plugin-rax-kraken/src/setEntry.js index bb200543a8..61fc5a8630 100644 --- a/packages/plugin-rax-kraken/src/setEntry.js +++ b/packages/plugin-rax-kraken/src/setEntry.js @@ -3,18 +3,10 @@ const path = require('path'); module.exports = (config, context) => { const { rootDir } = context; - const target = 'kraken'; - // SPA const appEntry = moduleResolve(formatPath(path.join(rootDir, './src/app'))); const entryConfig = config.entry('index'); - config.module.rule('platform-loader') - .use('platform-loader') - .options({ - platform: target, - }); - entryConfig.add(appEntry); }; diff --git a/packages/rax-app/package.json b/packages/rax-app/package.json index f276d87d87..b0c5ad5fd5 100644 --- a/packages/rax-app/package.json +++ b/packages/rax-app/package.json @@ -1,6 +1,6 @@ { "name": "rax-app", - "version": "3.0.7", + "version": "3.0.8", "description": "command line interface and builtin plugin for rax app", "author": "ice-admin@alibaba-inc.com", "homepage": "https://github.com/alibaba/ice#readme", @@ -16,11 +16,11 @@ "dependencies": { "@alib/build-scripts": "^0.1.24", "build-plugin-app-core": "0.1.23", - "build-plugin-rax-app": "6.0.0", + "build-plugin-rax-app": "6.0.1", "build-plugin-ice-store": "1.7.8", "build-plugin-rax-web": "1.0.6", "build-plugin-rax-weex": "1.0.6", - "build-plugin-rax-kraken": "1.0.5", + "build-plugin-rax-kraken": "1.0.6", "build-plugin-rax-miniapp": "1.1.0", "build-plugin-ssr": "1.0.6", "chokidar": "^3.3.1",