-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·118 lines (110 loc) · 2.49 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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
const join = require('path').join;
const resolve = require('path').resolve;
const webpack = require('webpack');
const OpenBrowserPlugin = require('open-browser-webpack-plugin');
const PATHS = {
src: join(__dirname, 'src'),
fonts: join(__dirname, 'fonts'),
build: join(__dirname, 'build')
};
module.exports = {
entry: "./src/index.js",
devServer: {
inline: true,
host: '0.0.0.0',
port: '3000',
watchOptions: {
aggregateTimeout: 300,
poll: true
}
},
output: {
path: __dirname,
filename: "./build/bundle.js"
},
module: {
loaders: [
{
test: /\.css$/,
loader: "style!css"
},
{
test: /\.scss$/,
loaders: ['style', 'css', 'sass?sourceMap']
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015']
}
},
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
loader: 'file?name=public/fonts/[name].[ext]'
}
]
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new OpenBrowserPlugin({ url: 'http://localhost:3000'}),
]
};
/*module.exports = {
entry: {
src: join(PATHS.src, 'index.js')
},
resolve: {
extensions: ['', '.js']
},
output: {
path: PATHS.build,
publicPath: '/pong/',
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.css$/,
loaders: ['style', 'css'],
include: PATHS.src
}, {
test: /\.js$/,
loader: 'babel',
include: PATHS.src,
exclude: /node_modules/
}, {
test: /\.(eot|svg|ttf|woff|woff2)$/,
include : PATHS.fonts,
loader: `file?name=/fonts/[name].[ext]`
}]
},
devtool: 'eval-source-map',
devServer: {
contentBase: process.cwd(),
historyApiFallback: true,
hot: true,
inline: true,
progress: true,
// display only errors to reduce the amount of output
stats: 'errors-only',
// parse host and port from env so this is easy
// to customize
host: process.env.HOST,
port: process.env.PORT
},
devServer: {
inline: true,
host: '0.0.0.0',
port: '3000',
watchOptions: {
aggregateTimeout: 300,
poll: true
},
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new OpenBrowserPlugin({ url: 'http://localhost:8080/webpack-dev-server/bundle'}),
new OpenBrowserPlugin({ url: 'http://localhost:3000'}),
]
};*/