Gulp-Uglify错误:意外令牌:名称(查询)

时间:2019-01-13 09:36:40

标签: javascript ecmascript-6 babeljs gulp-uglify

我正试图使我的资产捆绑工作,但Quill失败。 我的bundle.conf.json

options: {
    uglify: ['production'], // uglify the resulting bundle in prod
    rev: ['production'], // rev the resulting bundle in prod
    transforms: {
      scripts: lazypipe().pipe(babel, {
        presets: ['es2015']
      }
      )
    }
  }
},
vendor: {
  scripts: [
    "./public/assets/bower_components/quill/quill.js",
    ],

我正在使用babel6。错误文件为quill.js(第一行):

import Quill from './core';

错误:

[09:34:13] ERROR in custom transforms for 'vendor.scripts':
[09:34:13] Error in plugin 'gulp-uglify'
Message:
/home/ubuntu/workspace/atlas3src/public/assets/bower_components/quill/quill.js: Unexpected token: name (Quill)
Details:
    fileName: /home/ubuntu/workspace/atlas3src/public/assets/bower_components/quill/quill.js
    lineNumber: 1

1 个答案:

答案 0 :(得分:0)

您的工具配置中是否存在除node_modules目录之外的任何内容?

https://github.com/quilljs/quill/issues/1175#issuecomment-266401537