Created
August 29, 2018 07:25
-
-
Save JaeYeopHan/355c5826207d047a702c5c20e4191370 to your computer and use it in GitHub Desktop.
Useful external option of webpack config
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
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