Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PavelPolyakov/df6453e74e6eb47540e5ddfac61add58 to your computer and use it in GitHub Desktop.
Save PavelPolyakov/df6453e74e6eb47540e5ddfac61add58 to your computer and use it in GitHub Desktop.
webpack.config.js
const webpack = require('webpack');
const paths = require('./paths');
var autoprefixer = require('autoprefixer');
module.exports = function (storybookBaseConfig, configType) {
storybookBaseConfig.module.rules.push(...[
{
include: paths.appStory,
test: /\.(css)$/,
use: [
'style-loader',
`css-loader`
]
}, {
include: paths.appSrc,
test: /\.scss$/,
use: [
'style-loader',
`css-loader`,
'postcss-loader',
`sass-loader`
]
}, {
include: paths.appStory,
test: /\.(woff)$/,
use: [`url-loader`]
}, {
include: paths.appSrc,
test: /\.(js|jsx)$/,
use: [`babel-loader`]
}]);
storybookBaseConfig.plugins.push(
new webpack.LoaderOptionsPlugin({
options: {
postcss: [
autoprefixer(),
]
}
})
);
storybookBaseConfig.devtool = 'source-map';
storybookBaseConfig.resolve = {
modules: [paths.appNodeModules, paths.appSrc],
extensions: ['.js', '.jsx', '.scss', '.woff']
};
return storybookBaseConfig;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment