Skip to content

Instantly share code, notes, and snippets.

@doncams
Last active December 8, 2015 17:36
Show Gist options
  • Select an option

  • Save doncams/f37c119e9179f4039459 to your computer and use it in GitHub Desktop.

Select an option

Save doncams/f37c119e9179f4039459 to your computer and use it in GitHub Desktop.
let config = {
supercalifragilisticexpialidocious: true
};
module.exports = config;
let config = {
superlongpropertyname: true
};
module.exports = config;
import _ from 'lodash';
let config = require('./a.js');
config = _.assign(config, require('./b.js'));
module.exports = config;
import config from './config/config.js';
console.log(config);
var path = require('path');
var fs = require('fs');
var webpack = require('webpack');
var nodeModules = {};
fs.readdirSync('node_modules').filter(function(x) {
return ['.bin'].indexOf(x) === -1;
}).forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});
module.exports = {
context: path.join(__dirname, ''),
target: 'node',
node: {
fs: 'empty'
},
externals: nodeModules,
plugins: [
],
resolve: {
extensions: ['', '.js', '.jsx', '.json']
},
module: {
loaders: [{
test: require.resolve('./config/config.js'),
exclude: /node_modules/,
loader: 'json!val!to-string!babel'
}, {
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}]
},
entry: './index.js',
output: {
path: __dirname,
filename: 'bundle.js'
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment