mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-23 00:22:57 +05:30
Disable dll plugin in storybook
This commit is contained in:
parent
925a3a868e
commit
3cd2d21fce
@ -44,7 +44,7 @@
|
||||
"build:quiet": "yarn run clean && yarn run build:webpack --quiet",
|
||||
"build:dll": "node ./packages/scripts/build-dll.js",
|
||||
"build:serve": "http-server --proxy https://dev.account.ely.by ./build",
|
||||
"sb": "start-storybook -p 9009 --ci",
|
||||
"sb": "APP_ENV=storybook start-storybook -p 9009 --ci",
|
||||
"build-storybook": "build-storybook"
|
||||
},
|
||||
"husky": {
|
||||
|
@ -25,9 +25,11 @@ const isProduction = process.env.NODE_ENV === 'production';
|
||||
const isAnalyze = process.argv.some(arg => arg === '--analyze');
|
||||
|
||||
const isDockerized = !!process.env.DOCKERIZED;
|
||||
const isStorybook = process.env.APP_ENV === 'storybook';
|
||||
const isCI = !!process.env.CI;
|
||||
const isSilent = isCI || process.argv.some(arg => /quiet/.test(arg));
|
||||
const isCspEnabled = false;
|
||||
const enableDll = !isProduction && !isStorybook;
|
||||
|
||||
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
||||
|
||||
@ -91,7 +93,7 @@ const webpackConfig = {
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'packages/app/index.ejs',
|
||||
favicon: 'packages/app/favicon.ico',
|
||||
scripts: isProduction ? [] : ['/dll/vendor.dll.js'],
|
||||
scripts: enableDll ? ['/dll/vendor.dll.js'] : [],
|
||||
hash: false, // webpack does this for all our assets automagically
|
||||
filename: 'index.html',
|
||||
inject: false,
|
||||
@ -281,13 +283,17 @@ if (isProduction) {
|
||||
// this will improve build performance
|
||||
// this mode will be default for dev builds in webpack 5
|
||||
new EagerImportsPlugin(),
|
||||
|
||||
new webpack.DllReferencePlugin({
|
||||
context: __dirname,
|
||||
manifest: require('./dll/vendor.json'),
|
||||
}),
|
||||
);
|
||||
|
||||
if (enableDll) {
|
||||
webpackConfig.plugins.push(
|
||||
new webpack.DllReferencePlugin({
|
||||
context: __dirname,
|
||||
manifest: require('./dll/vendor.json'),
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
webpackConfig.devServer = {
|
||||
host: 'localhost',
|
||||
port: 8080,
|
||||
|
Loading…
Reference in New Issue
Block a user