config.module
.rule('js') // Find the rule.
.use('babel-loader') // Find the loader
.tap(options => Object.assign(options, { // Modifying options
plugins: ['babel-plugin-import']
}))
Ref: webpack-chain > Config module rules uses> modifying options
// config.js
chainWebpack: (config, isServer) => {
config.module
.rule('js') // Find the rule.
.use('babel-loader') // Find the loader
.tap(options => Object.assign(options, { // Modifying options
plugins: ['babel-plugin-import']
}))
}
Error:
ERROR in ./node_modules/_@[email protected]@@vuepress/core/lib/app/clientEntry.js
Module build failed (from ./node_modules/[email protected]@babel-loader/lib/index.js):
Detailed error log?
BTW: please DON'T use issue to ask question next time.
where ask question ;)
聽Discord server (Recommended), forum, or StackOverflow聽馃檪
Discord server is Response timeout WTF GFW~
If you can't even get over the wall... I can't help you nothing.
Thinks. u are nice and Helpful man.
I have solved the problem
chainWebpack: (config, isServer) => {
config.module
.rule('js') // Find the rule.
.use('babel-loader') // Find the loader
.tap(options => Object.assign(options, { // Modifying options
plugins: [
["import", {
"libraryName": "ant-design-vue",
"libraryDirectory": "es",
"style": "css"
}]
]
}))
}
Cool, so we just forgot options for this plugin (I don't know and don鈥檛 use it). but you should know this is not very safe if the internal babel options has occupied the plugins option.
Have other good plan?
And why its not safe?
Thank you for your research on the configuration, this problem troubles me a lot.
Most helpful comment
Thinks. u are nice and Helpful man.
I have solved the problem