一個(gè)祖?zhèn)骼洗a打包驹吮,提示如下錯(cuò)誤:
ReferenceError: webpackJsonp is not defined
at http://localhost:8100/build/main.js:1:1
一搜發(fā)現(xiàn)應(yīng)該是使用了新版本的Ionic-App-Scripts導(dǎo)致的:
This is a breaking change in Ionic-App-Scripts
https://github.com/ionic-team/ionic-app-scripts/releases/tag/v2.0.0src/index.html must be modified to include a new vendor script tag .
中文意思是:這版本有一個(gè)斷式變更短荐,src/index.html
文件需要一個(gè)包含vendor script
的標(biāo)簽担租,即需要添加這一段:
<script src="build/vendor.js"></script>
而且必須要放在<script src="build/main.js"></script>
前面女揭,完成后如下:
...
<body>
<!-- Ionic's root component and where the app will load -->
<ion-app></ion-app>
<script src="cordova.js"></script>
<!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>
<!-- all code from node_modules directory is here -->
<script src="build/vendor.js"></script>
<!-- The bundle js is generated during the build process -->
<script src="build/main.js"></script>
</body>