Last active
December 8, 2017 18:09
-
-
Save vitalets/72347de2c18b7d64230942b4cdf53c2f to your computer and use it in GitHub Desktop.
Mocha ES6 modules: webpack config final
This file contains 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
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