Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(storybook): Resetting static dirs when building - FRONT-3789 #2682

Merged
merged 7 commits into from
Nov 22, 2022
Merged
8 changes: 7 additions & 1 deletion src/playground/ec/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');

const isBuild = process.env.NODE_ENV;
const isProd = process.env.NODE_ENV === 'production';
const outputFolder = isProd ? 'dist' : 'build';

Expand All @@ -18,12 +19,17 @@ const addons = [
'@storybook/addon-a11y',
];

const staticDirs = [
let staticDirs = [
path.resolve(`${__dirname}/../../../presets/ec/${outputFolder}`),
path.resolve(`${__dirname}/../../../presets/reset/${outputFolder}`),
path.resolve(`${__dirname}/../../../presets/rtl/${outputFolder}`),
];

// FRONT-3789 - No need for static dirs, we manually copy the files.
if (isBuild) {
staticDirs = [];
}

const webpackFinal = (config) => {
// Trick "babel-loader", force it to transpile @ecl addons
config.module.rules[0].exclude = /node_modules\/(?!@ecl\/).*/;
Expand Down
8 changes: 7 additions & 1 deletion src/playground/eu/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');

const isBuild = process.env.NODE_ENV;
const isProd = process.env.NODE_ENV === 'production';
const outputFolder = isProd ? 'dist' : 'build';

Expand All @@ -18,12 +19,17 @@ const addons = [
'@storybook/addon-a11y',
];

const staticDirs = [
let staticDirs = [
path.resolve(`${__dirname}/../../../presets/eu/${outputFolder}`),
path.resolve(`${__dirname}/../../../presets/reset/${outputFolder}`),
path.resolve(`${__dirname}/../../../presets/rtl/${outputFolder}`),
];

// FRONT-3789 - No need for static dirs, we manually copy the files.
if (isBuild) {
staticDirs = [];
}

const webpackFinal = (config) => {
// Trick "babel-loader", force it to transpile @ecl addons
config.module.rules[0].exclude = /node_modules\/(?!@ecl\/).*/;
Expand Down