forked from yhat/rodeo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.dev.config.js
105 lines (103 loc) · 2.93 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
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
'use strict';
const path = require('path'),
pkg = require('./package.json'),
webpack = require('webpack');
module.exports = {
context: path.join(__dirname, 'src/browser/jsx'),
debug: true,
devtool: 'source-map',
entry: {
startup: [
'react-hot-loader/patch',
'webpack-hot-middleware/client?path=http://localhost:3001/__webpack_hmr',
'webpack/hot/only-dev-server',
'./entry/startup'
],
main: [
'react-hot-loader/patch',
'webpack-hot-middleware/client?path=http://localhost:3001/__webpack_hmr',
'webpack/hot/only-dev-server',
'./entry/main'
],
'free-tabs-only': [
'react-hot-loader/patch',
'webpack-hot-middleware/client?path=http://localhost:3001/__webpack_hmr',
'webpack/hot/only-dev-server',
'./entry/free-tabs-only'
]
},
externals: {
'ascii-table': 'AsciiTable',
jquery: 'jQuery',
templates: 'templates',
ace: 'ace',
ipc: 'ipc'
},
module: {
// preLoaders: [
// {test: /\.js$/, loader: "eslint-loader", exclude: /node_modules/}
// ],
loaders: [
{ test: /\.json/, loader: 'json' },
{ test: /\.less$/, loader: 'style!css!less' },
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.(png|gif)$/, loader: 'url?name=[name].[hash].[ext]&limit=8192' }, // inline base64 URLs for <=8k images, direct URLs for the rest
{ test: /\.svg$/, loaders: ['file?name=[name].[hash].[ext]', 'svgo?useConfig=svgoConfig1'] },
{ test: /\.md$/, loader: 'raw' }, // because we sometimes treat it differently based on the context (i.e., code)
{ test: /\.ya?ml$/, loader: 'json!yaml' }, // some things we want to change often, so it goes in config files
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
cacheDirectory: true,
query: {
plugins: ['react-hot-loader/babel', 'lodash'],
presets: ['react', 'es2015']
}
},
{
test: /\.jsx?$/,
include: [
path.resolve(__dirname, 'node_modules/rulejs')
],
loader: 'babel',
cacheDirectory: true,
query: {
plugins: ['lodash'],
presets: ['es2015']
}
}
]
},
node: {
__filename: true,
__dirname: true
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
__APP_NAME__: JSON.stringify(pkg.name),
__VERSION__: JSON.stringify(pkg.version),
'process.env': {
NODE_ENV: JSON.stringify('development')
}
}),
],
output: {
filename: '[name].js',
path: path.join(__dirname, 'dist'),
publicPath: 'http://localhost:3001/dist/'
},
stats: {
colors: true
},
svgoConfig1: {
plugins: [
{removeTitle: true},
{convertColors: {shorthex: false}},
{convertPathData: false}
]
},
target: 'electron-renderer'
};