Skip to content

Commit

Permalink
fix(storybook): Resetting static dirs when building - FRONT-3789 (#2682)
Browse files Browse the repository at this point in the history
Co-authored-by: Romain Emery <emery.romain@gmail.com>
  • Loading branch information
planctus and emeryro committed Nov 22, 2022
1 parent d20b972 commit 7de4741
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/playground/ec/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const webpack = require('webpack');

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

const publicUrl = process.env.PUBLIC_URL || '';
const stories = ['../../../implementations/twig/**/!(eu*).story.js'];

Expand All @@ -18,12 +17,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 (isProd) {
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: 6 additions & 2 deletions src/playground/eu/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const webpack = require('webpack');

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

const publicUrl = process.env.PUBLIC_URL || '';
const stories = ['../../../implementations/twig/**/!(ec*).story.js'];

Expand All @@ -18,12 +17,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 (isProd) {
staticDirs = [];
}

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

1 comment on commit 7de4741

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.