在build/webpack.base.conf.js添加, 然后配置下面的代码:
1、const webpack = require('webpack')
2、在js规则中添加exclude
module: { rules: [ { test: /\.js$/, exclude: /node_modules(?!\/quill-image-drop-module|quill-image-resize-module)/, loader: 'babel-loader', include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] }, ] } 3、 plugins: [ new webpack.ProvidePlugin({ 'window.Quill': 'quill' }) ],