-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
53 lines (52 loc) · 1.22 KB
/
webpack.config.js
File metadata and controls
53 lines (52 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const webpack = require('webpack')
const path = require('path')
const root = __dirname
const paths = {
src: path.join(root, '../src'),
dist: path.join(root, '../dist')
}
module.exports = {
plugins: [
new webpack.NormalModuleReplacementPlugin(/^\.\/layout$/, 'custom-layout'),
new webpack.NormalModuleReplacementPlugin(/^\.\/controls$/, 'custom-controls')
],
resolve: {
alias: {
'custom-layout': path.resolve('.storybook/layout.js'),
'custom-controls': path.resolve('.storybook/controls.js')
}
},
module: {
loaders: [{
test: /\.html$/,
loader: 'file?name=[name].[ext]'
}, {
test: /\.json$/,
loader: 'json'
}, {
test: /\.css$/,
loader: 'style!css?modules',
include: paths.src
}, {
test: /\.css$/,
loader: 'style!css',
include: paths.node_modules
}, {
test: /\.styl$/,
loader: 'style!css?modules!stylus',
include: paths.src
}, {
test: /\.jsx?$/,
loader: 'babel',
// only handle js file in src
include: paths.src
}, {
test: /\.(jpe?g|png|gif|svg)$/i,
loader: 'url'
}],
noParse: [
// 'react/dist/react.js',
// 'react-dom/dist/react-dom.js'
]
}
}