6502SimDesktop/webpack.config.base.js
2017-03-10 15:23:36 -06:00

41 lines
884 B
JavaScript

/**
* 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 || {})
});