insomnia/webpack/webpack.config.base.js
Gregory Schier 9c11a7d61c Switch to LokiJS (#12)
* LokiJS is working pretty well

* Tidy up
2016-04-26 20:17:05 -07:00

71 lines
1.6 KiB
JavaScript

import path from 'path'
import pkg from '../app/package.json'
export default {
devtool: 'source-map',
context: path.join(__dirname, '../app'),
entry: [
'./index.js',
'./app.html'
],
output: {
path: path.join(__dirname, '../dist'),
filename: 'bundle.js',
libraryTarget: 'commonjs2'
},
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: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
loader: "file"
},
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: "url?limit=10000&mimetype=image/svg+xml"
},
{
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"
}
]
},
resolve: {
extensions: ['', '.js', '.json', '.jsx'],
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
},
externals: [
// Omit all the app package dependencies (we want them loaded at runtime via NodeJS)
...Object.keys(pkg.dependencies)
],
plugins: [],
target: 'electron-renderer'
};