mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-17 21:53:03 +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:quiet": "yarn run clean && yarn run build:webpack --quiet",
|
||||||
"build:dll": "node ./packages/scripts/build-dll.js",
|
"build:dll": "node ./packages/scripts/build-dll.js",
|
||||||
"build:serve": "http-server --proxy https://dev.account.ely.by ./build",
|
"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"
|
"build-storybook": "build-storybook"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
|
@ -25,9 +25,11 @@ const isProduction = process.env.NODE_ENV === 'production';
|
|||||||
const isAnalyze = process.argv.some(arg => arg === '--analyze');
|
const isAnalyze = process.argv.some(arg => arg === '--analyze');
|
||||||
|
|
||||||
const isDockerized = !!process.env.DOCKERIZED;
|
const isDockerized = !!process.env.DOCKERIZED;
|
||||||
|
const isStorybook = process.env.APP_ENV === 'storybook';
|
||||||
const isCI = !!process.env.CI;
|
const isCI = !!process.env.CI;
|
||||||
const isSilent = isCI || process.argv.some(arg => /quiet/.test(arg));
|
const isSilent = isCI || process.argv.some(arg => /quiet/.test(arg));
|
||||||
const isCspEnabled = false;
|
const isCspEnabled = false;
|
||||||
|
const enableDll = !isProduction && !isStorybook;
|
||||||
|
|
||||||
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
process.env.NODE_ENV = isProduction ? 'production' : 'development';
|
||||||
|
|
||||||
@ -91,7 +93,7 @@ const webpackConfig = {
|
|||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: 'packages/app/index.ejs',
|
template: 'packages/app/index.ejs',
|
||||||
favicon: 'packages/app/favicon.ico',
|
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
|
hash: false, // webpack does this for all our assets automagically
|
||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
inject: false,
|
inject: false,
|
||||||
@ -281,12 +283,16 @@ if (isProduction) {
|
|||||||
// this will improve build performance
|
// this will improve build performance
|
||||||
// this mode will be default for dev builds in webpack 5
|
// this mode will be default for dev builds in webpack 5
|
||||||
new EagerImportsPlugin(),
|
new EagerImportsPlugin(),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (enableDll) {
|
||||||
|
webpackConfig.plugins.push(
|
||||||
new webpack.DllReferencePlugin({
|
new webpack.DllReferencePlugin({
|
||||||
context: __dirname,
|
context: __dirname,
|
||||||
manifest: require('./dll/vendor.json'),
|
manifest: require('./dll/vendor.json'),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
webpackConfig.devServer = {
|
webpackConfig.devServer = {
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
|
Loading…
Reference in New Issue
Block a user