6502SimDesktop/webpack.config.base.js

41 lines
884 B
JavaScript
Raw Normal View History

2017-03-10 21:23:36 +00:00
/**
* Base webpack config used across other specific configs
*/
import path from 'path';
import validate from 'webpack-validator';
import { dependencies as externals } from './package.json';
export default validate({
module: {
loaders: [{
test: /\.jsx?$/,
loaders: ['babel-loader'],
exclude: /node_modules/
}, {
test: /\.json$/,
loader: 'json-loader'
}]
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
// https://github.com/webpack/webpack/issues/1114
libraryTarget: 'commonjs2'
},
/**
* Determine the array of extensions that should be used to resolve modules.
*/
resolve: {
extensions: ['', '.js', '.jsx', '.json'],
packageMains: ['webpack', 'browser', 'web', 'browserify', ['jam', 'main'], 'main']
},
plugins: [],
externals: Object.keys(externals || {})
});