-
Notifications
You must be signed in to change notification settings - Fork 22
/
webpack.demos.config.js
38 lines (37 loc) · 887 Bytes
/
webpack.demos.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
/* eslint import/no-extraneous-dependencies: 0 */
const webpack = require('webpack');
const path = require('path');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
entry: [
path.resolve(__dirname, 'src/example/index.js'),
],
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: './dist/',
filename: 'example_app.js',
},
watch: true,
module: {
loaders: [{
test: /\.js?$/,
loader: 'babel',
exclude: /node_modules/,
include: path.resolve(__dirname, 'src'),
}]
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
APP_ENV: JSON.stringify(process.env.APP_ENV),
},
}),
new BrowserSyncPlugin({
host: process.env.IP || 'localhost',
port: process.env.PORT || 3001,
server: {
baseDir: ['./', './build']
}
})
]
}