-
-
Save doncams/f37c119e9179f4039459 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let config = { | |
| supercalifragilisticexpialidocious: true | |
| }; | |
| module.exports = config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let config = { | |
| superlongpropertyname: true | |
| }; | |
| module.exports = config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import _ from 'lodash'; | |
| let config = require('./a.js'); | |
| config = _.assign(config, require('./b.js')); | |
| module.exports = config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import config from './config/config.js'; | |
| console.log(config); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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