-
Notifications
You must be signed in to change notification settings - Fork 37
/
webpack.config.js
48 lines (47 loc) · 1.18 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
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const structureGenerator = require('./scripts/structure-generator');
module.exports = {
entry: {
main: './style-guide/client.js',
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loaders: ['babel'],
}, {
test: /\.json$/,
loaders: ['json'],
}, {
test: /\.s?css$/,
loaders: ['style', 'css', 'postcss', 'sass'],
}],
},
output: {
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new HtmlWebpackPlugin({
template: './style-guide/index.ejs',
basename: '/',
}),
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
__INCLUDE_CSS__: true,
__STRUCTURE__: JSON.stringify(structureGenerator()),
__BASENAME__: '"/"',
__DEVELOPMENT__: true,
}),
],
resolve: {
alias: {
'bw-axiom': path.resolve(__dirname, 'src'),
'style-guide': path.resolve(__dirname, 'style-guide/components'),
},
},
postcss: () => [autoprefixer({ browsers: ['last 2 versions'] })],
};