-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix(webpack): fix consola IE compatibility #6298
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
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #6298 +/- ##
=======================================
Coverage 95.61% 95.61%
=======================================
Files 79 79
Lines 2693 2693
Branches 697 697
=======================================
Hits 2575 2575
Misses 101 101
Partials 17 17
Continue to review full report at Codecov.
|
packages/webpack/src/config/base.js
Outdated
@@ -215,7 +216,7 @@ export default class WebpackBaseConfig { | |||
alias () { | |||
return { | |||
...this.buildContext.options.alias, | |||
consola: require.resolve(`consola/dist/consola${this.isServer ? '' : '.browser'}.js`) | |||
consola: require.resolve(`consola/${this.isServer ? 'dist/consola' : 'src/browser'}.js`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because consola server build
will bundle dependencies like dayjs
which are not in deps of Nuxt, so use dist/consola.js
for server build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
An overall description of different methods to resolve this issue and why going with method of PR. Problem: We use consola only for development mode. The browser dist use some features that IE9 does not support that makes debugging impossible during dev for IE. Solutions:
As consola is only used for dev for browser, our main priority is best DX (not best perf for end-users) and best DX is fastest Silly benchmark: Src: 3.95 / 3.67 / 3.37 / 3.49 |
@pi0 will it affect production build size in any way or it only increases dev bundle? |
@AndrewBogdanovTSS no it is dev only. And no effect on dev bundle as we had it as before. |
@pi0 you meant no effect on prod bundle? |
@AndrewBogdanovTSS No change for the prod bundle, no "noticable" effect for the dev bundle besides IE11 compat |
Just updated my project to Nuxt v.2.10.0 - IE still throw errors about Consola in dev mode:
|
I’ll have a look |
See #5743
Types of changes
Description
Checklist: