-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
66 lines (62 loc) · 1.63 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
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin')
// var openBrowserWebpackPlugin = require('open-browser-webpack-plugin');
var APP_PATH = path.resolve(__dirname, './src/app.jsx');
var MAIN_PATH = path.resolve(__dirname, './app/main.js');
var BUILD_PATH = path.resolve(__dirname, './app');
var config = {
entry: {
bundle: APP_PATH
},
output: {
path: BUILD_PATH,
filename: '[name].js'
},
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['babel-loader?presets[]=es2015,presets[]=react'],
exclude: /node_modules/
},
{
test: /\.css?$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
}]
},
target: "electron",
// node: {
// __dirname: false,
// __filename: false
// },
// target: 'node',
// node: {
// fs: "empty"
// },
devtool: 'source-map',
devServer: {
contentBase: "./app",
noInfo: true,
hot: true,
inline: true,
publicPath: 'http://localhost:8080/',
port: 8080,
headers: {
'Access-Control-Allow-Origin': '*'
},
stats: {
colors: true
}
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin("./style/[name].css", {allChunks: false})
// new openBrowserWebpackPlugin({ url: 'http://localhost:8080' })
],
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
}
}
}
module.exports = config