How to use Webpack IgnorePlugin #16625
Unanswered
CITjakob
asked this question in
CLI - SSR mode
Replies: 1 comment
-
You can check this: #1955 const webpack = require('webpack')
module.exports = configure(function (ctx) {
return {
build: {
extendWebpack (cfg) {
cfg.plugins.push(
new webpack.ProvidePlugin({
$: 'jquery'
})
)
}
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everybody
I read about this issues in other threads already (e.g. here #12492) but could not find an answer anywhere.
I need to make the Webpack IgnorePlugin (https://webpack.js.org/plugins/ignore-plugin/) work with quasar, but when adding it to the quasar.conf.js I always get errors I am not able to solve.
Here is what I added at
build
:As far as I understand the docs for Quasar and Webpack, this way my imports of any JSON files inside the boot directory should be ignored by Webpack. However I get the following error:
I realize this is because the plugin is loaded twice and on the second run it cannot set the
__pluginArgs
property on the config in node_modules/webpack-chain/src/Plugin.js:83 (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_redefine_property)When I fix this error (by adding
configurable: true
) to test it, I then get the following errors:So to me it looks like it's not possible to configure the ignore-webpack-plugin via the quasar.conf.js correctly. I could not find a way to keep webpack from bundling JSON files I import dynamically even though the resulting js bundles are not used anywhere.
Any help would be highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions