Exclude files from webpack bundle (server only javascript)
[issue link]I am using xmldom to shim the document on the server-side. However, I don’t need xmldom on the client and would like to exclude it from the webpack bundle.
Here’s what I have so far in my nuxt.config.js:
build: {
extend (config, { isDev, isClient }) {
if (!config.externals) return
config.externals = config.externals.filter(p => p !== 'xmldom')
}
},
This results in non-optimal bundles sizes: