Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加阿里的ali-oss插件后编译失败 #768

Closed
cybibo opened this issue Mar 22, 2018 · 4 comments
Closed

添加阿里的ali-oss插件后编译失败 #768

cybibo opened this issue Mar 22, 2018 · 4 comments

Comments

@cybibo
Copy link

cybibo commented Mar 22, 2018

Failed to compile.

index.js from UglifyJs
Unexpected token: name (Mime) [index.js:62173,8]

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: roadhog build
npm ERR! Exit status 1
npm ERR!

@superlbr
Copy link
Collaborator

superlbr commented Mar 23, 2018

分两步:

  1. 无视错误编译出来,build 后面加个--watch,build success最后会卡住,ctrl +c就好了。原理就是毕竟是UglifyJs的锅
  2. 分析这个问题,找到报错的地方,我贴出来吧,该不该找下ali-oss
 class Mime {
    constructor() {
      this._types = Object.create(null);
      this._extensions = Object.create(null);

      for (var i = 0; i < arguments.length; i++) {
        this.define(arguments[i]);
      }
    }
  1. 建议ali-oss放到server端

@yzzting
Copy link

yzzting commented Mar 26, 2018

建议采用CDN的方式引入

@cybibo
Copy link
Author

cybibo commented Mar 28, 2018

目前解决是采用CDN方式引入没问题。
@superlbr,对,就是这个地方报错,个人认为是不是该采用babel-loader
ali-sdk/ali-oss#313

@superlbr
Copy link
Collaborator

云谦是打包大师,跟他提了一下,此issue不再跟踪,Close
@cybibo 可以贴下CDN怎么引入的,方便后来人

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants