-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
52 lines (51 loc) · 1.36 KB
/
webpack.config.js
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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const path = require('path');
module.exports = {
devtool: 'eval',
entry: [
'react-hot-loader/patch',
path.resolve(__dirname, './src/index')
],
output: {
path: path.resolve(__dirname, './build'),
filename: 'index.js'
},
devServer: {
historyApiFallback: true,
inline: true,
port: 3000
},
resolve: {
alias: {
atoms: path.resolve(__dirname, 'src/components/1-atoms/'),
molecules: path.resolve(__dirname, 'src/components/2-molecules/'),
organisms: path.resolve(__dirname, 'src/components/3-organisms/'),
pages: path.resolve(__dirname, 'src/components/4-pages/'),
styles: path.resolve(__dirname, 'src/styles/'),
variables: path.resolve(__dirname, 'src/styles/1-tools/1_variables.scss')
}
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel-loader']
}, {
test: /\.scss$/,
loader: ExtractTextPlugin.extract('css-loader?modules&importLoaders=1&localIdentName=[local]!sass-loader')
}
]
},
plugins : [
new HtmlWebpackPlugin({
template: './index.html'
}),
new ExtractTextPlugin({
filename: 'styles/main.css',
disable: false,
allChunks: true
})
]
};