-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
65 lines (63 loc) · 1.48 KB
/
webpack.config.js
File metadata and controls
65 lines (63 loc) · 1.48 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const manifest = require('./dev/manifest.json');
module.exports = {
context: path.resolve(__dirname, './dev'),
entry: {
app: './assets/bundle.js',
},
output: {
path: path.resolve(__dirname, './production'),
filename: './assets/bundle.js',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader",
options: {
presets: ["es2015"]
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
loader: 'css-loader!postcss-loader'
}),
},
{
test: /\.(jpe?g|png|gif|svg)$/i,
loader: "file-loader?name=[path][name].[ext]"
},
{
test: /\.(pdf|txt|xml|json|mp4)$/i,
loader: "file-loader?name=[path][name].[ext]"
}
]
},
plugins: [
new ExtractTextPlugin("./assets/bundle.css"),
new HtmlWebpackPlugin({
name: manifest.name,
theme_color: manifest.theme_color,
template: 'index.ejs',
hash: false,
minify: false,
}),
],
devServer: {
contentBase: path.join(__dirname, "production"),
compress: false,
port: 8080,
watchContentBase: true,
watchOptions: {
poll: true
},
inline: true,
lazy: false
},
watch: false,
};