forked from sqlectron/sqlectron-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
77 lines (76 loc) · 1.73 KB
/
webpack.dev.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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
require('babel-polyfill');
module.exports = {
debug: true,
devtool: 'eval-source-map',
target: 'electron-renderer',
resolve: {
extensions: ['', '.js'],
modulesDirectories: ['node_modules', 'src/renderer'],
alias: {
'dtrace-provider': path.join(__dirname, 'empty-shim.js'),
},
},
entry: {
app: [
'webpack/hot/dev-server',
'./src/renderer/entry.jsx',
],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/',
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /(node_modules|vendor)/,
loaders: ['babel'],
},
{
test: /\.s?css$/,
loaders: [
'style',
'css',
'autoprefixer?browsers=last 2 version',
'sass?includePaths[]=' + path.resolve(__dirname, 'node_modules'),
],
},
{
test: /\.png$/,
loader: 'url?mimetype=image/png',
},
{
test: /\.gif$/,
loader: 'url?mimetype=image/gif',
},
{
test: /\.(?:eot|ttf|woff2?|svg)$/,
loader: 'file?name=[path][name]-[hash:6].[ext]&context=assets',
},
{
test: /\.json?$/,
loader: 'json',
},
],
noParse: [/html2canvas/],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
hot: true,
template: 'src/renderer/index.html',
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
}),
],
};