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): apply a webpack tweak for storybook and angular #8392

Merged
merged 2 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ module.exports = {
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}




// remove html raw-loader that breaks Jit compilation
const rules = (config.module.rules ?? []).filter(
(rule) =>
rule.test !== /\\\\.html$/ &&
rule.exclude !== /\\\\.async\\\\.html$/ &&
!rule.loader?.includes('raw-loader')
);
config.module.rules = [...rules];


// add your own webpack tweaks if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ module.exports = {
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}




// remove html raw-loader that breaks Jit compilation
const rules = (config.module.rules ?? []).filter(
(rule) =>
rule.test !== /\\\\.html$/ &&
rule.exclude !== /\\\\.async\\\\.html$/ &&
!rule.loader?.includes('raw-loader')
);
config.module.rules = [...rules];


// add your own webpack tweaks if needed
Expand Down Expand Up @@ -59,13 +70,24 @@ module.exports = {
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}

// for backwards compatibility call the \`rootWebpackConfig\`
// this can be removed once that one is migrated fully to
// use the \`webpackFinal\` property in the \`main.js\` file
config = rootWebpackConfig({ config });



// remove html raw-loader that breaks Jit compilation
const rules = (config.module.rules ?? []).filter(
(rule) =>
rule.test !== /\\\\.html$/ &&
rule.exclude !== /\\\\.async\\\\.html$/ &&
!rule.loader?.includes('raw-loader')
);
config.module.rules = [...rules];


// add your own webpack tweaks if needed

return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,24 @@ module.exports = {
if (rootMain.webpackFinal) {
config = await rootMain.webpackFinal(config, { configType });
}

<% if (existsRootWebpackConfig) { %>// for backwards compatibility call the `rootWebpackConfig`
// this can be removed once that one is migrated fully to
// use the `webpackFinal` property in the `main.js` file
config = rootWebpackConfig({ config });
<% } %>

<% if (uiFramework === '@storybook/angular') { %>
// remove html raw-loader that breaks Jit compilation
const rules = (config.module.rules ?? []).filter(
(rule) =>
rule.test !== /\.html$/ &&
rule.exclude !== /\.async\.html$/ &&
!rule.loader?.includes('raw-loader')
);
config.module.rules = [...rules];
<% } %>

// add your own webpack tweaks if needed

return config;
Expand Down