Created
June 9, 2017 15:26
-
-
Save PavelPolyakov/df6453e74e6eb47540e5ddfac61add58 to your computer and use it in GitHub Desktop.
webpack.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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