mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
fix: whitelist vue&type=style in SSR bundle
This commit is contained in:
parent
21882caa50
commit
dfab96fdb7
@ -59,12 +59,16 @@ export default class WebpackServerConfig extends BaseConfig {
|
|||||||
|
|
||||||
// https://webpack.js.org/configuration/externals/#externals
|
// https://webpack.js.org/configuration/externals/#externals
|
||||||
// https://github.com/liady/webpack-node-externals
|
// https://github.com/liady/webpack-node-externals
|
||||||
|
// https://vue-loader.vuejs.org/migrating.html#ssr-externals
|
||||||
this.options.modulesDir.forEach(dir => {
|
this.options.modulesDir.forEach(dir => {
|
||||||
if (fs.existsSync(dir)) {
|
if (fs.existsSync(dir)) {
|
||||||
config.externals.push(
|
config.externals.push(
|
||||||
nodeExternals({
|
nodeExternals({
|
||||||
// load non-javascript files with extensions, presumably via loaders
|
whitelist: [
|
||||||
whitelist: [/es6-promise|\.(?!(?:js|json)$).{1,5}$/i],
|
/es6-promise|\.(?!(?:js|json)$).{1,5}$/i,
|
||||||
|
/\.css$/,
|
||||||
|
/\?vue&type=style/
|
||||||
|
],
|
||||||
modulesDir: dir
|
modulesDir: dir
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user