Ionic在Generating ES5 bundles for differential loadind的时候报错
在使用IONIC时用ionic cordova build android进行编译的时候报如下错误
ng.cmd run app:ionic-cordova-build --platform=android
Generating ES5 bundles for differential loading...
An unhandled exception occurred: [BABEL] F:\code\Ionic\hg\www\0-es2015.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "F:\\code\\Ionic\\hg\\node_modules\\@babel\\preset-env\\lib\\index.js")
See "C:\Users\CXK\AppData\Local\Temp\ng-xjeznd\angular-errors.log" for further details.
[ERROR] An error occurred while running subprocess ng.
出现原因是IONIC在下载的时候少下了proposal-numeric-separator插件.
1、用npm下载该插件即可
npm install --save-dev @babel/plugin-proposal-numeric-separator
2、在项目目录搜available-plugins.js文件如下图所示:
3、用文本编辑器打开分别输入如下两段代码
var _pluginProposalNumericSeparator = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));
"proposal-numeric-separator": _pluginProposalNumericSeparator.default,
4、之后再执行ionic cordova build android即可。