【问题标题】:Gulp-Uglify Error: unexpected token: name (Quill)Gulp-Uglify 错误:意外令牌:名称(Quill)
【发布时间】:2019-01-13 09:36:39
【问题描述】:

我正在尝试让我的资产捆绑工作,但它在 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",
    ],

我正在使用 babel 6。错误的文件是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

【问题讨论】:

    标签: javascript ecmascript-6 babeljs gulp-uglify


    【解决方案1】:

    您的工具配置中是否有任何不包括node_modules 目录的内容?

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-18
      • 2018-08-29
      • 1970-01-01
      • 2023-03-17
      • 2015-12-21
      • 2018-05-14
      • 1970-01-01
      相关资源
      最近更新 更多