Created
October 15, 2017 22:00
-
-
Save fstanis/450776f48682e6ff85b7c7ba366a5d1e to your computer and use it in GitHub Desktop.
Webpack ProvidePlugin polyfill guard bug
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
console.log(mdl); |
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
if (typeof mdl === 'undefined') { | |
module.exports = { name: 'test' }; | |
} else { | |
module.exports = mdl; | |
} |
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
const webpack = require('webpack'); | |
module.exports = { | |
output: { | |
filename: 'out.js', | |
}, | |
entry: './app.js', | |
plugins: [ | |
new webpack.ProvidePlugin({ | |
// Changing "mdl:" to anything else will make it work | |
mdl: './module.js' | |
}) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment