Skip to content

Instantly share code, notes, and snippets.

@JaeYeopHan
Created August 29, 2018 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JaeYeopHan/355c5826207d047a702c5c20e4191370 to your computer and use it in GitHub Desktop.
Save JaeYeopHan/355c5826207d047a702c5c20e4191370 to your computer and use it in GitHub Desktop.
Useful external option of webpack config
externals: [
function(context, request, callback) {
if ((/packages\/[^\/]+\//g).test(context)){
if (!/^\./g.test(request)) {
console.log("exclude", request);
return callback(null, 'commonjs ' + request);
}
}
callback();
}],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment