forked from kamilio/axiom-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (43 loc) · 1.11 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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const generateComponentProps = require('./scripts/component-docs');
const modulesToTranspile = [
'get-own-enumerable-property-symbols',
'stringify-object',
];
module.exports = {
devtool: 'source-map',
entry: './style-guide/client.js',
module: {
rules: [{
test: /\.js$/,
exclude: new RegExp(`node_modules/(?!(${modulesToTranspile.join('|')}))`),
use: ['babel-loader'],
}, {
test: /\.css$/,
use: ['style-loader', 'css-loader', 'postcss-loader'],
}],
},
output: {
filename: 'bundle.js',
publicPath: '/',
},
plugins: [
new HtmlWebpackPlugin({
template: './style-guide/index.ejs',
basename: '/',
}),
new webpack.DefinePlugin({
__BASENAME__: '"/"',
__COMPONENT_PROPS__: JSON.stringify(generateComponentProps()),
__DEVELOPMENT__: true,
}),
],
resolve: {
alias: {
'bw-axiom': path.resolve(__dirname, 'src'),
'style-guide': path.resolve(__dirname, 'style-guide/components'),
},
},
};