Closed eightHundreds closed 3 months ago
node v16.19.0 unplugin 1.10.1
const Config = require('webpack-chain'); const myPlugin = require('my-plugin/webpack'); const config = new Config(); config .plugin('xxx') .use(myPlugin);
Inside the webpack-chain it will instantiate the plugin as a constructor However, since the plugins provided by unplugin are anonymous arrow functions
So it can't be instantiated
No response
the solution
const Config = require('webpack-chain'); const myPlugin = require('my-plugin/webpack'); const config = new Config(); config .plugin('xxx') - .use(myPlugin); + .use(myPlugin());
According to the docs, our design is as follows.
// webpack.config.js module.exports = { /* ... */ plugins: [ require('unplugin-starter/webpack')({ /* options */ }) ] }
Environment
node v16.19.0 unplugin 1.10.1
Reproduction
Describe the bug
Inside the webpack-chain it will instantiate the plugin as a constructor However, since the plugins provided by unplugin are anonymous arrow functions
So it can't be instantiated
Additional context
No response
Logs
No response