-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack.config.js
82 lines (79 loc) · 2.01 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
const ExtractTextPlugin = require( 'extract-text-webpack-plugin' );
const webpackTargetElectronRenderer = require( 'webpack-target-electron-renderer' );
/**
* @todo Switch to Webpack 2
* @todo Split vendor
*/
module.exports = {
entry: {
'elf': './src/native-messaging/elf.js',
'main': './src/main/main.js',
'renderer-intro': './src/renderers/intro/intro.js',
'renderer-index-api-ai': './src/renderers/index-api-ai/index-api-ai.js',
'renderer-index-wit-ai': './src/renderers/index-wit-ai/index-wit-ai.js',
'renderer-activation': './src/renderers/activation/activation.js',
'renderer-check-process-running': './src/renderers/helper-native-messaging/check-process-running.js',
},
output: {
filename: '[name].bundle.js',
chunkFilename: '[id].bundle.js',
path: __dirname + '/bundle',
},
module: {
preLoaders: [
{
test: /\/.js$/,
exclude: /node_modules/,
loader: 'jshint-loader',
},
],
loaders: [
{
test: /\.css$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract( 'style-loader', 'css-loader!postcss-loader' ),
},
{
test: /\.js/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
cacheDirectory: true,
plugins: [
'transform-class-properties',
'transform-es2015-arrow-functions',
],
presets: [
'react',
'es2015',
],
},
},
{
test: /\.json/,
loader: 'json-loader',
},
{
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
exclude: /node_modules/,
loader: 'url-loader?limit=100000',
},
],
},
plugins: [
new ExtractTextPlugin( '../bundle/[name].bundle.css' ),
],
postcss: [
require( 'precss' ),
],
resolve: {
extensions: [
'',
'.css',
'.js',
'.json',
],
},
watch: true,
};
module.exports.target = webpackTargetElectronRenderer( module.exports );