I'm trying to add the @babel/plugin-transform-classes to a webpack configuration. I've installed the NPM module and tried to activate it using the following configuration:
const transform = require.resolve("@babel/plugin-transform-classes")
module.exports = {
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options['transformAssetUrls'] = {
img: 'src',
image: 'xlink:href'
}
return options
});
config.plugin('transform')
.use(transform, [])
}
}
This generates the following error:
error WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.plugins[13] misses the property 'apply'.
function
-> The run point of the plugin, required method.
How should I modify the above to correctly load the plugin?