Skip to content

Instantly share code, notes, and snippets.

@vitalets
Last active December 8, 2017 18:09
Show Gist options
  • Save vitalets/72347de2c18b7d64230942b4cdf53c2f to your computer and use it in GitHub Desktop.
Save vitalets/72347de2c18b7d64230942b4cdf53c2f to your computer and use it in GitHub Desktop.
Mocha ES6 modules: webpack config final
module.exports = {
entry: ['./setup.js', './run.js'],
output: {
filename: 'bundle.js',
},
resolve: {
alias: {
// map remote chai.js url to locally installed in node_modules
'https://unpkg.com/[email protected]/chai.js': 'chai/chai.js'
}
},
module: {
rules: [
{
// load chai.js like a normal <script> tag
test: require.resolve('chai/chai.js'),
use: 'script-loader'
}
]
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment