只为成功找方法,不为失败找理由。

博客园 首页 新随笔 联系 订阅 管理

I'm new to Ionic. I have started project with super template. But when I try to run the app in browser. It throws an error saying:

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

  

解决:

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 .

<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>

 

posted on 2017-11-03 23:12  诗意的活着  阅读(1954)  评论(0编辑  收藏  举报