Skip to content

Commit

Permalink
Exclude all rules from template-stories
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeasday committed Sep 14, 2022
1 parent 024e8a7 commit 2dc7254
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) {
module: {
...config.modules,
rules: [
// Ensure esbuild-loader applies to all files in ./template-stories
{
test: [/\\/template-stories\\//],
loader: '${loaderPath}',
Expand All @@ -229,7 +230,11 @@ function addEsbuildLoaderToStories(mainConfig: ConfigFile) {
target: 'es2015',
},
},
...config.module.rules,
// Ensure no other loaders from the framework apply
...config.module.rules.map(rule => ({
...rule,
exclude: [/\\/template-stories\\//].concat(rule.exclude || []),
})),
],
},
})`;
Expand Down

0 comments on commit 2dc7254

Please sign in to comment.