forked from rlmcneary2/rjs-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
44 lines (40 loc) · 1.3 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
"use strict";
const constants = require("./buildConstants");
const path = require("path");
const webpack = require("webpack");
module.exports = {
devtool: "source-maps",
entry: `.${path.sep}${path.join(constants.srcRender, constants.appEntryFile)}`,
module: {
loaders: [
{
include: [
path.resolve(__dirname, constants.srcRender)
],
loader: "babel-loader",
query: {
plugins: ["transform-async-to-generator"], // Only necessary until Electron + Chrome supports async / await (any day now).
presets: ["react"],
retainLines: true,
},
test: /\.jsx?$/
},
{
include: [
path.resolve(__dirname, constants.srcLocale),
path.resolve(__dirname, constants.srcRender)
],
loader: "json-loader",
test: /\.json$/
}
]
},
output: {
filename: constants.appOutputFile,
path: path.join(constants.dist, constants.distApp),
},
plugins: [
new webpack.DefinePlugin({ "process.env": { NODE_ENV: process.env.NODE_ENV } })
],
target: "electron-renderer"
};