forked from wednesday-solutions/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
38 lines (35 loc) · 1018 Bytes
/
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
const path = require('path');
const genBaseConfig = require('../internals/webpack/webpack.config.base');
const colors = require('../app/themes/colors');
module.exports = ({ config }) => {
// hack cause smart knobs is not working on production
process.env.NODE_ENV = 'development';
config.resolve.alias = genBaseConfig(config).resolve.alias;
config.module.rules.push({
test: /\.less$/,
use: [
{
loader: 'style-loader'
},
{
loader: 'css-loader'
},
{
loader: 'less-loader',
options: {
lessOptions: {
javascriptEnabled: true,
modifyVars: {
'primary-color': colors.secondary
}
}
}
}
],
include: path.resolve(__dirname, '../')
});
config.resolve.modules.push('app');
config.resolve.extensions.push('.js', '.jsx', '.react.js');
config.module.rules[0].use[0].options.plugins = [require.resolve('babel-plugin-react-docgen')];
return config;
};