Splitted webpack config into base and dev. Re-use it in .storybook webpack config.
This commit is contained in:
45
webpack.base.js
Normal file
45
webpack.base.js
Normal file
@ -0,0 +1,45 @@
|
||||
const webpack = require('webpack');
|
||||
|
||||
module.exports = {
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.((png)|(eot)|(woff)|(woff2)|(ttf)|(svg)|(gif))(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'url-loader?limit=100000'
|
||||
},
|
||||
{
|
||||
test: /\.json$/,
|
||||
loader: 'json-loader'
|
||||
},
|
||||
{
|
||||
test: /\.scss$/,
|
||||
loader: 'style!css?modules!sass',
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: 'style!css?modules&importLoaders=1&&localIdentName=cms__[name]__[local]!postcss',
|
||||
},
|
||||
{
|
||||
loader: 'babel',
|
||||
test: /\.js?$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
query: {
|
||||
cacheDirectory: true,
|
||||
presets: ['react', 'es2015'],
|
||||
plugins: [
|
||||
'transform-class-properties',
|
||||
'transform-object-assign',
|
||||
'transform-object-rest-spread',
|
||||
'lodash',
|
||||
'react-hot-loader/babel'
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
postcss: [
|
||||
require('postcss-import')({ addDependencyTo: webpack }),
|
||||
require('postcss-cssnext')
|
||||
],
|
||||
};
|
Reference in New Issue
Block a user