-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report] Polyfills are not included correctly #1168
Comments
Any status on this enhancement? |
Hi, any plan to add this enhancement? |
Hi, I have used this configuration option https://vuepress.vuejs.org/config/#head to add my own polyfill URL (with the Promise support and other features such as Array.forEach)
|
@alex-arriaga I've found for my specific case this hasn't worked |
I've created a new branch to help find the bug: https://github.com/meteorlxy/vuepress/tree/fix/polyfill Steps to repro
Conclusion The polyfills are bundled, but are not imported to the html files correctly VuePress is using @sodatea Would you please give some guidance? |
Any updates on this ? It looks like some polyfills make it in but not all required. I was able to resolve it temporarly using polyfill.io. For me I was only missing: // .vuepress/config.js
head: [
['script', {
src: 'https://polyfill.io/v3/polyfill.min.js?features=Object.assign%2CPromise%2CNodeList.prototype.forEach'
}]
], |
included in the build output (fix vuejs#1168)
I think this will be fixed by #2317. Until that is released, this is what I'm doing Workaround
My {
"scripts": {
"build": "VUE_CLI_ENTRY_FILES=['\"'$PWD/node_modules/@vuepress/core/lib/client/clientEntry.js'\"','\"'$PWD/node_modules/@vuepress/core/lib/client/serverEntry.js'\"'] vuepress build"
}
} I think this syntax only works on mac and linux. Someone smarter than me can probably figure out how to do it on windows. Maybe using cross-env module? Run the script with:
Sanity check after rebuildingOption 1Use
// .vuepress/config.js
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
chainWebpack(config, isServer) {
if (!isServer) {
config
.plugin("webpack-bundle-analyzer")
.use(BundleAnalyzerPlugin)
.init(Plugin => new Plugin());
}
}
}; Option 2Run a build with un-minified code // .vuepress/config.js
module.exports = {
chainWebpack(config, isServer) {
config.optimization
.minimize(false);
}
}; Then go into your dist directory and grep Option 3Deploy somewhere and open it in IE11? |
@psalaets Cool! I'll review it asap 👍 |
Great thanks to @psalaets ❤️ The fix will be released in next version |
Co-Authored-By: meteorlxy <[email protected]>
Bug report
Version
[email protected]
Steps to reproduce
By the way, the website is https://ms-design.github.io.
Its source files locate in https://github.com/ms-design/ms-design/tree/develop/docs
What is expected?
experience like on Chrome
What is actually happening?
Promise
is an invalid API on IE11Other relevant information
When i input
Promise
on console of IE11, there is an undefined error, just likeThe text was updated successfully, but these errors were encountered: