Open aljones15 opened 1 year ago
Currently we have 8 default plugins:
https://github.com/digitalbazaar/bedrock-webpack/blob/5d4834f620392f7bcb6c27710b2b38d79c7e1a30/lib/index.js#L393-L400
https://github.com/digitalbazaar/bedrock-webpack/blob/5d4834f620392f7bcb6c27710b2b38d79c7e1a30/lib/index.js#L460
https://github.com/digitalbazaar/bedrock-webpack/blob/5d4834f620392f7bcb6c27710b2b38d79c7e1a30/lib/index.js#L483-L487
the proposal is to create a new section in this library's config file which exposes the settings for these Plugins. This would allow projects to modify the plugin settings if needed.
Add:
config['bedrock-webpack'].pluginOptions = { cleanWebpackPlugin: { }, htmlWebpackPlugin: { template: path.join(__dirname, '..', 'templates', 'index.html') }, statsPlugin: { }, terserPlugin: { }, vueLoaderPlugin: { }, progressPlugin: { }, hotModuleReplacementPlugin: { }, cleanWebpackPlugin: { } }
Then inside of index.js simply reference this when creating a plugin.
index.js
new CleanWebpackPlugin(config.pluginOptions.cleanWebpackPlugin);
Why:
config['bedrock-webpack'].configs
Currently we have 8 default plugins:
https://github.com/digitalbazaar/bedrock-webpack/blob/5d4834f620392f7bcb6c27710b2b38d79c7e1a30/lib/index.js#L393-L400
https://github.com/digitalbazaar/bedrock-webpack/blob/5d4834f620392f7bcb6c27710b2b38d79c7e1a30/lib/index.js#L460
https://github.com/digitalbazaar/bedrock-webpack/blob/5d4834f620392f7bcb6c27710b2b38d79c7e1a30/lib/index.js#L483-L487
the proposal is to create a new section in this library's config file which exposes the settings for these Plugins. This would allow projects to modify the plugin settings if needed.
Add:
Then inside of
index.js
simply reference this when creating a plugin.Why:
config['bedrock-webpack'].configs
for using non-json data structures such as classes