insomnia/webpack/base.config.js
2016-04-17 21:39:15 -07:00

81 lines
1.8 KiB
JavaScript

var path = require('path');
var webpack = require('webpack');
var webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
var config = {
target: 'web',
devtool: 'source-map',
context: path.join(__dirname, '../app'),
entry: [
'./index.js',
'./electron.html'
],
output: {
path: path.join(__dirname, '../dist'),
filename: 'bundle.js'
},
module: {
loaders: [
{
id: 'babel',
test: /\.(js|jsx)$/,
loaders: ['babel'],
exclude: /node_modules/
},
{
test: /\.json$/,
loader: 'json'
},
{
test: /\.(scss|css)$/,
loader: 'style!css!sass'
},
{
test: /\.html$/,
loader: "file?name=[name].[ext]"
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff"
},
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/font-woff"
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=application/octet-stream"
},
{
test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: "file"
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=image/svg+xml"
}
]
},
resolve: {
extensions: ['', '.js', '.json', '.jsx'],
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
},
plugins: [
new webpack.DefinePlugin({
__DEV__: true,
'process.env': {
NODE_ENV: JSON.stringify('development')
}
}),
new webpack.ExternalsPlugin('commonjs', [
'request',
'nunjucks',
'pouchdb',
'pouchdb-find'
])
]
};
config.target = webpackTargetElectronRenderer(config);
module.exports = config;