hyper/webpack.config.js
Benjamin Staneck 263caa0659 Dependency updates (#1958)
* Dependency updates

* update babel-loader, electron-builder, electron-builder-squirrel-windows

* update node-pty to 0.6.9

release notes: https://github.com/Tyriar/node-pty/releases

* update node-pty to 0.6.10

release notes: https://github.com/Tyriar/node-pty/releases/tag/0.6.10

* update electron-builder

* more dependency updates

* Update Electron and family

Electron release notes: https://github.com/electron/electron/releases/tag/v1.6.12

* Update redux to 3.7.2

* Update webpack to 3.x and enable ModuleConcatenation

Basically absorb PR #1967

* Update react and react-dom

* also absorb the changes of PR https://github.com/zeit/hyper/pull/2056
2017-08-08 16:29:54 -04:00

47 lines
1,011 B
JavaScript

const path = require('path');
const webpack = require('webpack');
const Copy = require('copy-webpack-plugin');
const nodeEnv = process.env.NODE_ENV || 'development';
const isProd = nodeEnv === 'production';
module.exports = {
resolve: {
extensions: ['.js', '.jsx']
},
devtool: isProd ? 'hidden-source-map' : 'cheap-module-source-map',
entry: './lib/index.js',
output: {
path: path.join(__dirname, 'app', 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.json/,
loader: 'json-loader'
}
]
},
plugins: [
new webpack.DefinePlugin({
'process.env': { // eslint-disable-line quote-props
NODE_ENV: JSON.stringify(nodeEnv)
}
}),
new webpack.optimize.ModuleConcatenationPlugin(),
new Copy([
{
from: './assets',
to: './assets'
}
])
],
target: 'electron'
};