Skip to content

Instantly share code, notes, and snippets.

@pedrobritto
Created September 25, 2019 12:25
Show Gist options
  • Save pedrobritto/77110b7c556644841ea2d30946c07767 to your computer and use it in GitHub Desktop.
Save pedrobritto/77110b7c556644841ea2d30946c07767 to your computer and use it in GitHub Desktop.
webpack config for storybook (absolute paths and css modules)
const path = require('path');
module.exports = ({config}) => {
config.module.rules.push({
test: /\.scss$/,
loaders: [
require.resolve('style-loader'),
{
loader: require.resolve('css-loader'),
options: {
importLoaders: 1,
modules: true,
localIdentName: '[local]-[hash:base64:5]',
},
},
require.resolve('sass-loader')
],
});
config.resolve.modules = [
...(config.resolve.modules || []),
path.resolve(__dirname, '../'),
];
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment