2017-03-03 01:44:07 +00:00
|
|
|
const path = require('path');
|
2017-11-26 20:45:40 +00:00
|
|
|
const pkg = require('../package.json');
|
2016-03-16 05:49:42 +00:00
|
|
|
|
2017-03-03 01:44:07 +00:00
|
|
|
module.exports = {
|
2016-03-22 05:01:58 +00:00
|
|
|
devtool: 'source-map',
|
2016-03-16 20:02:47 +00:00
|
|
|
context: path.join(__dirname, '../app'),
|
|
|
|
entry: [
|
2016-11-30 03:55:27 +00:00
|
|
|
'./renderer.js',
|
|
|
|
'./renderer.html'
|
2016-03-16 20:02:47 +00:00
|
|
|
],
|
|
|
|
output: {
|
2016-07-18 20:10:18 +00:00
|
|
|
path: path.join(__dirname, '../build'),
|
2016-04-20 02:14:53 +00:00
|
|
|
filename: 'bundle.js',
|
|
|
|
libraryTarget: 'commonjs2'
|
2016-03-16 20:02:47 +00:00
|
|
|
},
|
|
|
|
module: {
|
2017-02-26 21:12:51 +00:00
|
|
|
rules: [
|
2016-03-16 20:02:47 +00:00
|
|
|
{
|
2017-03-08 00:45:18 +00:00
|
|
|
test: /\.(js)$/,
|
2017-03-03 01:44:07 +00:00
|
|
|
use: ['babel-loader'],
|
2017-03-03 20:09:08 +00:00
|
|
|
exclude: [/node_modules/, /__fixtures__/, /__tests__/]
|
2016-04-16 23:24:57 +00:00
|
|
|
},
|
2017-07-25 04:15:24 +00:00
|
|
|
{
|
|
|
|
// To make
|
|
|
|
test: /\.(js|flow)$/,
|
|
|
|
use: ['babel-loader'],
|
|
|
|
include: [/node_modules\/graphql-language-service-interface/]
|
|
|
|
},
|
2016-03-16 20:02:47 +00:00
|
|
|
{
|
2016-08-29 17:58:59 +00:00
|
|
|
test: /\.(less|css)$/,
|
2017-02-26 21:12:51 +00:00
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
{loader: 'css-loader', options: {importLoaders: 1}},
|
2017-03-03 20:09:08 +00:00
|
|
|
{loader: 'less-loader', options: {noIeCompat: true}}
|
|
|
|
]
|
2017-02-26 21:12:51 +00:00
|
|
|
},
|
|
|
|
{
|
2017-03-03 01:44:07 +00:00
|
|
|
test: /\.(html|woff2)$/,
|
2017-02-26 21:12:51 +00:00
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
2017-03-03 20:09:08 +00:00
|
|
|
name: '[name].[ext]'
|
|
|
|
}
|
2017-03-03 01:44:07 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(png)$/,
|
2017-03-03 20:09:08 +00:00
|
|
|
loader: 'url-loader'
|
2016-03-16 20:02:47 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
2017-02-26 21:12:51 +00:00
|
|
|
extensions: ['.js', '.json'],
|
|
|
|
mainFields: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
|
2016-04-15 16:50:29 +00:00
|
|
|
},
|
2017-11-04 20:53:40 +00:00
|
|
|
node: {
|
|
|
|
__dirname: false // Use Node __dirname
|
|
|
|
},
|
2016-04-20 06:09:46 +00:00
|
|
|
externals: [
|
2016-10-02 20:57:00 +00:00
|
|
|
// Omit all dependencies in app/package.json (we want them loaded at runtime via NodeJS)
|
2017-11-26 20:45:40 +00:00
|
|
|
...Object.keys(pkg.dependencies).filter(name => !pkg.packedDependencies.includes(name)),
|
2017-01-27 01:00:27 +00:00
|
|
|
|
|
|
|
// To get jsonlint working...
|
2017-03-03 20:09:08 +00:00
|
|
|
'file', 'system'
|
2016-04-20 02:14:53 +00:00
|
|
|
],
|
2017-08-21 18:11:52 +00:00
|
|
|
plugins: [],
|
2016-04-20 02:14:53 +00:00
|
|
|
target: 'electron-renderer'
|
2016-03-16 20:02:47 +00:00
|
|
|
};
|