前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Ionic 3-: ReferenceError: webpackJsonp is not defined

Ionic 3-: ReferenceError: webpackJsonp is not defined

作者头像
IT晴天
发布2020-03-20 14:50:58
1.4K0
发布2020-03-20 14:50:58
举报
文章被收录于专栏:ionic3+

一个祖传老代码打包,提示如下错误:

ReferenceError: webpackJsonp is not defined at http://localhost:8100/build/main.js:1:1

一搜发现应该是使用了新版本的Ionic-App-Scripts导致的:

This is a breaking change in Ionic-App-Scripts https://github.com/ionic-team/ionic-app-scripts/releases/tag/v2.0.0 src/index.html must be modified to include a new vendor script tag .

中文意思是:这版本有一个断式变更,src/index.html文件需要一个包含vendor script的标签,即需要添加这一段:

代码语言:javascript
复制
  <script src="build/vendor.js"></script>

而且必须要放在<script src="build/main.js"></script>前面,完成后如下:

代码语言:javascript
复制
...
<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>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档