vue-cli3, 新增加了image-webpack-loader, 在vue.config.js中增加以下内容,结果导致报错:
chainWebpack: config => {
config.module
.rule('images')
.test(/.(png|jpe?g|gif|svg|ico)(?.*)?$/)
.use('image-webpack-loader')
.loader('image-webpack-loader')
.options({bypassOnDebug:true})
}
报错:
? Building for production...
ERROR Failed to compile with 1 errors 00:28:09
error in ./src/App.vue?vue&type=style&index=0&lang=scss&
Syntax Error: ModuleBuildError: Module build failed (from ./node_modules/[email protected]@image-webpack-loader/index.js):
SyntaxError: Invalid regular expression: /^.*?((?<label>.*?)[,)]/: Invalid group
@ ./src/App.vue?vue&type=style&index=0&lang=scss& 1:0-480 1:0-480
@ ./src/App.vue
@ ./src/main.js
@ multi ./src/main.js
ERROR Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
有没有人遇到这种问题,或者要怎么排查?