forked from eureka-io/MindFeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
34 lines (29 loc) · 1.02 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const fs = require('fs');
const lessToJs = require('less-vars-to-js');
const themeVariables = lessToJs(fs.readFileSync(path.join(__dirname, './client/src/css/ant-theme-vars.less'), 'utf8'));
const config = {
entry: [
'babel-polyfill',
'./client/src/index.js'
],
devtool: 'cheap-module-eval-source-map',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index_bundle.js',
publicPath: '/'
},
module: {
rules: [
{ test: /\.(js)$/, use: 'babel-loader', exclude: /node_modules/ },
{ test: /\.(png|jpg|gif|jpeg)$/, use: [ { loader: 'file-loader', options: {} }] },
{ test: /\.(css)$/, use: ['style-loader', 'css-loader']},
{ test: /\.less$/, use: [ {loader: "style-loader"}, {loader: "css-loader"}, {loader: "less-loader", options: { modifyVars: themeVariables }} ] }
],
},
plugins: [
new HtmlWebpackPlugin({template: './client/src/index.html'}),
]
}
module.exports = config;