-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (44 loc) · 1.44 KB
/
webpack.config.js
File metadata and controls
46 lines (44 loc) · 1.44 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
var path = require('path');
var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
var APP_PATH = path.resolve(__dirname, 'app');
var SRC_PATH = path.resolve(__dirname, 'src');
module.exports = {
cache: true,
target: 'electron',
devtool: 'source-map',
entry: {
ui: './src/ui/ui'
},
output: {
path: APP_PATH,
filename: '[name].js',
chunkFilename: '[chunkhash].js',
sourceMapFilename: '[name].map'
},
module: {
loaders: [
{
test: /\.js|\.jsx?$/,
loader: 'babel-loader',
include: [SRC_PATH],
query: {
presets: ['es2015', 'react'],
}
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader'}
]
},
plugins: [
new webpack.optimize.DedupePlugin(),
//new webpack.optimize.UglifyJsPlugin({comments: false}),
new webpack.EnvironmentPlugin(["NODE_ENV"]),
new CopyWebpackPlugin([
{ from: path.resolve(SRC_PATH, 'main.js'), to: 'main.js' },
{ from: path.resolve(SRC_PATH, 'backend'), to: 'backend' },
{ from: path.resolve(SRC_PATH, 'ui/index.html'), to: 'index.html' },
{ from: path.resolve(SRC_PATH, 'package.json'), to: 'package.json' }
])
]
};