Fix the development only js-yaml dependency being included in the release builds (#2646)

This commit is contained in:
absidue 2022-10-02 02:12:13 +02:00 committed by GitHub
parent 402ddf5cc7
commit dc2cc746cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -163,6 +163,12 @@ if (isDevMode) {
processLocalesPlugin,
new webpack.DefinePlugin({
'process.env.LOCALE_NAMES': JSON.stringify(processLocalesPlugin.localeNames)
}),
// webpack doesn't get rid of js-yaml even though it isn't used in the production builds
// so we need to manually tell it to ignore any imports for `js-yaml`
new webpack.IgnorePlugin({
resourceRegExp: /^js-yaml$/,
contextRegExp: /i18n$/
})
)
}

View File

@ -189,6 +189,12 @@ if (isDevMode) {
},
},
]
}),
// webpack doesn't get rid of js-yaml even though it isn't used in the production builds
// so we need to manually tell it to ignore any imports for `js-yaml`
new webpack.IgnorePlugin({
resourceRegExp: /^js-yaml$/,
contextRegExp: /i18n$/
})
)
}