2017-01-12 19:26:36 +01:00
|
|
|
const path = require('path');
|
2017-05-23 09:41:26 +02:00
|
|
|
const webpack = require('webpack')
|
2017-05-05 06:28:30 +02:00
|
|
|
const WebpackNotifierPlugin = require('webpack-notifier')
|
|
|
|
|
2017-04-07 07:15:22 +02:00
|
|
|
const appPath = path.resolve(__dirname, 'js');
|
2017-01-12 19:26:36 +01:00
|
|
|
|
|
|
|
const PATHS = {
|
|
|
|
app: path.join(__dirname, 'app'),
|
|
|
|
dist: path.join(__dirname, '..', 'app', 'dist')
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: ['babel-polyfill', './js/main.js'],
|
|
|
|
output: {
|
|
|
|
path: path.join(PATHS.dist, 'js'),
|
|
|
|
publicPath: '/js/',
|
|
|
|
filename: "bundle.js",
|
|
|
|
pathinfo: true
|
|
|
|
},
|
|
|
|
debug: true,
|
|
|
|
cache: true,
|
|
|
|
devtool: 'eval',
|
2017-04-07 07:15:22 +02:00
|
|
|
resolve: {
|
|
|
|
root: appPath,
|
|
|
|
extensions: ['', '.js', '.jsx', '.css'],
|
|
|
|
},
|
2017-05-05 06:28:30 +02:00
|
|
|
plugins: [
|
|
|
|
new WebpackNotifierPlugin(),
|
2017-05-23 09:41:26 +02:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
ENV: JSON.stringify("development"),
|
|
|
|
}),
|
2017-05-05 06:28:30 +02:00
|
|
|
],
|
2017-01-12 19:26:36 +01:00
|
|
|
module: {
|
|
|
|
preLoaders: [
|
|
|
|
{
|
|
|
|
test: /\.jsx?$/,
|
|
|
|
loaders: ['eslint'],
|
|
|
|
// define an include so we check just the files we need
|
|
|
|
include: PATHS.app
|
|
|
|
}
|
|
|
|
],
|
|
|
|
loaders: [
|
|
|
|
{ test: /\.css$/, loader: "style!css" },
|
|
|
|
{
|
2017-04-07 07:15:22 +02:00
|
|
|
test: /\.jsx?$/,
|
|
|
|
loader: 'babel',
|
|
|
|
query: {
|
2017-01-12 19:26:36 +01:00
|
|
|
cacheDirectory: true,
|
|
|
|
presets:[ 'es2015', 'react', 'stage-2' ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
target: 'electron-main',
|
2017-04-20 16:45:39 +02:00
|
|
|
};
|