forked from Flexget/webui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
39 lines (36 loc) · 1.03 KB
/
webpack.dev.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
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
const webpack = require('webpack');
const path = require('path');
const config = require('./webpack.shared');
config.entry.main.push(
'webpack/hot/dev-server',
`webpack-dev-server/client?http://localhost:${process.env.PORT || 8000}`
);
config.output = {
path: __dirname,
filename: '[name].bundle.js',
publicPath: '/',
};
config.devtool = 'source-map';
config.plugins = [
new FaviconsWebpackPlugin(path.resolve('./src/favicon.png')),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('development'),
},
}),
new HtmlWebpackPlugin({
title: 'FlexGet Manager v2',
template: './src/index.ejs',
base: '/',
}),
];
config.module.rules.push({
test: /\.s?css$/,
loaders: ['style-loader', 'css-loader', 'resolve-url-loader'],
});
module.exports = config;