insomnia/webpack/webpack.config.base.babel.js

54 lines
1.2 KiB
JavaScript
Raw Normal View History

import path from 'path';
import * as pkg from '../app/package.json';
2016-03-16 05:49:42 +00:00
export default {
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'),
filename: 'bundle.js',
libraryTarget: 'commonjs2'
2016-03-16 20:02:47 +00:00
},
module: {
rules: [
2016-03-16 20:02:47 +00:00
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/, /__fixtures__/, /__tests__/],
2016-04-16 23:24:57 +00:00
},
2016-03-16 20:02:47 +00:00
{
2016-08-29 17:58:59 +00:00
test: /\.(less|css)$/,
use: [
'style-loader',
{loader: 'css-loader', options: {importLoaders: 1}},
{loader: 'less-loader', options: {noIeCompat: true}},
],
},
{
test: /\.(html|png|woff2)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]'
}
2016-03-16 20:02:47 +00:00
}
]
},
resolve: {
extensions: ['.js', '.json'],
mainFields: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
2016-04-15 16:50:29 +00:00
},
2016-04-20 06:09:46 +00:00
externals: [
// Omit all dependencies in app/package.json (we want them loaded at runtime via NodeJS)
...Object.keys(pkg.dependencies),
// To get jsonlint working...
'file', 'system',
],
2016-04-20 06:09:46 +00:00
plugins: [],
target: 'electron-renderer'
2016-03-16 20:02:47 +00:00
};