forked from scsibug/class-central
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
46 lines (44 loc) · 1.04 KB
/
webpack.dev.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
const webpack = require('webpack');
const config = require('./webpack.config');
const _ = require('lodash');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
config.devtool = 'eval';
config.devServer = {
inline: true,
hot: true,
host: "0.0.0.0",
port: "8081",
https: true,
};
config.module.rules.push({
test: [
/\.less$/,
/\.css$/
],
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: [
{
loader: 'css-loader',
},
{
loader: 'less-loader',
options: {
globalVars: {
imageUrl: "'https://class-central.test/bundles/classcentralsite/images/'",
assetUrl: "'https://class-central.test/bundles/classcentralsite/slashpixel/images/'"
}
}
},
]
})
});
config.output = {
path: __dirname + '/web/webpack/development',
filename: '[name].dev.js',
};
config.plugins = _.union(config.plugins, [
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin('[name].dev.css')
]);
module.exports = config;