使用weexpack构建weex应用时,npm run serve一直报这个错误

ERROR in index.web.js from UglifyJs
Unexpected token: name (urlParts) [index.web.js:3754,4] ERROR in App.web.js from UglifyJs
Unexpected token: name (urlParts) [App.web.js:3754,4] ERROR in page/web.web.js from UglifyJs
Unexpected token: name (urlParts)

UglifyJs报错解决方案:

  1. 在 webpack.config.js 的同目录下创建文件 .babelrc,内容如下

     { "presets": ["es2015"] }
  2. 如果上面的方法也不行,那就不使用UglifyJs,全局搜索 new webpack.optimize.UglifyJsPlugin({minimize: true}),注释掉这一行就好了。

     // web need vue-loader
    const plugins = [
    // new webpack.optimize.UglifyJsPlugin({minimize: true}), //这行不要
    new webpack.BannerPlugin({
    banner: '// { "framework": ' + (fileType === '.vue' ? '"Vue"' : '"Weex"') + '} \n',
    raw: true,
    exclude: 'Vue'
    })
    ];

如果这样还是不行,你就得把你的package.json中的命令修改一下

"serve": "webpack-dev-server --config webpack.dev.js -p --open" -> "serve": "webpack-dev-server --config webpack.dev.js --open"

@落雨

http://js-dev.cn

ERROR in index.web.js from UglifyJs的更多相关文章

  1. 用weex create 创建app项目 报 ERROR in index.web.js from UglifyJs 错误!

    用weex create创建一个APP项目,安装依赖后运行报 这个是package.json index.web.js 在dist目录下是build时生成的. 上面的答案没有给大家细节,不好意思致歉下 ...

  2. git报错 error: cannot stat ‘'web/js': Permission denied

    切换分支时报错: error: cannot stat ‘'web/js': Permission denied 解决方法:退出编辑器.浏览器.资源管理器等,然后再切换就可以了.

  3. 使用iview-project 打包build报错,ERROR in xxxxx.cheunk.js from UglifyJs

    一.iview-project  为iview官方推荐工程,一个基于iview的vue脚手架 github网址:https://github.com/iview/iview-project 废话不多说 ...

  4. 【解决】ERROR in xxx.js from UglifyJs

    当我们运行打包脚本npm run build或者打包iosweexpack build ios有可能会遇到以下报错 ERROR in index.js from UglifyJs ![](https: ...

  5. error: js/dist/app.js from UglifyJs Unexpected token: name (Dom7)

    What you did I have installed Swiper as normal dependency in my Project and import it to my scripts ...

  6. error in static/js/xxx.js from UglifyJs Unpected token: punc() [static/js/xxx.js]

    出现问题 使用vue+element-ui+webpack开发项目时,Jenkins构建出现报错error in static/js/xxx.js from UglifyJs Unpected tok ...

  7. 启动webpack-dev-server错误,ERROR in main.js from UglifyJs Unexpected token: name «element», expected: punc «;»

    启动webpack-dev-server出现以下错误 ERROR in main.js from UglifyJsUnexpected token: name «element», expected: ...

  8. android ReactNative之Cannot find entry file index.android.js in any of the roots

    android ReactNative之Cannot find entry file index.android.js in any of the roots 2018年04月02日 14:53:12 ...

  9. [ERROR][org.springframework.web.context.ContextLoader][main] Context initialization failed org.sprin

    做一个SSH为基础框架的webapp小DEMO,复制了一把以前可以跑的代码,竟发现无法初始化数据源,报错如下: [ERROR][org.springframework.web.context.Cont ...

随机推荐

  1. Project 03- STM32F4xx PID controller

    Project 03- STM32F4xx PID controller CMSIS files from ARM provides ARM Math functions. There are als ...

  2. STM32F4 Alternate function mapping

    #define GPIO_AF0_MCO // MCO (MCO1 and MCO2) Alternate Function mapping #define GPIO_AF0_RTC_50Hz // ...

  3. AI 实验--v_JULY_v

    http://blog.csdn.net/v_JULY_v http://www.julyedu.com/

  4. LINUX 内核守护进程

    http://alfred-sun.github.io/blog/2015/06/18/daemon-implementation/

  5. 报错:System.Data.Entity.Validation.DbEntityValidationException: 对一个或多个实体的验证失败

    使用MVC和EF,在保存数据的时候报错:System.Data.Entity.Validation.DbEntityValidationException: 对一个或多个实体的验证失败.有关详细信息, ...

  6. delphi版本修改PE头源码

    //VC++6外衣 1 OEPCODEFIVE: THEAD = ($55, $8B, $EC, $6A, $FF, $68, $00, $00, $00, $00, $68, $00, $00, $ ...

  7. 将 tomcat 安装成 windows 服务

    1.下载 tomcat 的windows 压缩包,一般以 .zip ,而且文件名中有 bin 的文件就是 2.解压下载的文件到某一个目录下,eg: TOMCAT_HOME 3.打开 cmd ,运行 % ...

  8. 解决xib布局方式支持ios6,ios7

    xcode5 中的界面布局 根据sdk 分成ios7.0 and Later 和 ios6.1 and Earlier 两种,那如何xib同时支持 ios6 和ios7 的界面呢 方法如下: 在xco ...

  9. ./adb: error while loading shared libraries: libncurses.so.5:

    from://http://stackoverflow.com/questions/10005907/eclipse-android-plugin-libncurses-so-5 sudo apt-g ...

  10. 商业web漏扫神器——appscan篇

      版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/dongfei2033/article/details/78472507 很快,已经到了三大商业漏 ...