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

[KOA-5703]: Bump css-loader and postcss-loader #2901

Merged
merged 1 commit into from
Jul 7, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ const sassFunctions = require('bpk-mixins/sass-functions');

const postCssPlugins = require('../scripts/webpack/postCssPlugins');

const { BPK_TOKENS, ENABLE_CSS_MODULES } = process.env;
Copy link
Contributor

@anambl anambl Jul 7, 2023

Choose a reason for hiding this comment

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

What was the purpose of ENABLE_CSS_MODULES var?

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks to be super old configuration which going through our docs and setup we never actually use anywhere so looks to be an irrelevant variable.

It also doesn't line up and work with the configuration we need to provide in the newer css-loader so that we can specify our localIndentName as it would either be a boolean or an object, which we always need to provide the localIndentName, modules would always need to be an object :)

Hope that helps, let me know if not

const { BPK_TOKENS } = process.env;
const rootDir = path.resolve(__dirname, '../');
const useCssModules = ENABLE_CSS_MODULES !== 'false';

module.exports = ({ config }) => {
config.module.rules.push({
Expand Down Expand Up @@ -56,14 +55,17 @@ module.exports = ({ config }) => {
loader: 'css-loader',
options: {
importLoaders: 1,
modules: useCssModules,
localIdentName: '[local]-[hash:base64:5]',
modules: {
localIdentName: '[local]-[hash:base64:5]',
},
},
},
{
loader: 'postcss-loader',
options: {
plugins: postCssPlugins,
postcssOptions: {
plugins: [postCssPlugins],
},
},
},
],
Expand All @@ -78,14 +80,17 @@ module.exports = ({ config }) => {
loader: 'css-loader',
options: {
importLoaders: 1,
modules: useCssModules,
localIdentName: '[local]-[hash:base64:5]',
modules: {
localIdentName: '[local]-[hash:base64:5]',
},
},
},
{
loader: 'postcss-loader',
options: {
plugins: postCssPlugins,
postcssOptions: {
plugins: [postCssPlugins],
},
},
},
{
Expand Down
Loading
Loading