Answer the question
In order to leave comments, you need to log in
What is the correct way to load polyfill for Promise in webpack 2?
Lazy man's path:
webpack.config.js
{
entry: ['core-js/fn/promise', './main.js']
};
if('Promise' in windoW){
// main.js
}else{
// Promise polyfill +
// main.js
}
Answer the question
In order to leave comments, you need to log in
For example like this:
<script>
window.Promise || document.write('<script src="https://unpkg.com/[email protected]/dist/es6-promise.auto.min.js"><\/script>');
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question