Skip to content
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

fix(webpack): resolve consola to latest #5729

Merged
merged 3 commits into from
May 14, 2019
Merged

fix(webpack): resolve consola to latest #5729

merged 3 commits into from
May 14, 2019

Conversation

clarkdo
Copy link
Member

@clarkdo clarkdo commented May 14, 2019

@clarkdo clarkdo requested a review from pi0 May 14, 2019 16:26
@clarkdo
Copy link
Member Author

clarkdo commented May 14, 2019

@pi0 Will consola change it in future ?

@pi0
Copy link
Member

pi0 commented May 14, 2019

@clarkdo We keep this dist path consistent :)

pi0
pi0 previously approved these changes May 14, 2019
@clarkdo
Copy link
Member Author

clarkdo commented May 14, 2019

@pi0 Changed. For server, if any code is using incompatible api between v1 and v2, it may still have error in SSR

So do you think it's necessary to add alias in server ?

@pi0
Copy link
Member

pi0 commented May 14, 2019

@clarkdo for node, it won't and is guarded here: https://github.com/nuxt/consola/blob/master/src/node.js#L31 (nuxt is first in the chian that loads latest consola)

For browser, we should add this guard :)

@clarkdo
Copy link
Member Author

clarkdo commented May 14, 2019

But SSR will be run in different context, webpack may still resolve wrong consola.

How about:

// base.js

  alias() {
    return {
      ...this.buildContext.options.alias,
      consola: require.resolve(`consola/dist/consola${this.isServer ? '' : '.browser'}.js`)
    }
  }

@codecov-io
Copy link

Codecov Report

Merging #5729 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             dev   #5729      +/-   ##
========================================
+ Coverage   95.6%   95.6%   +<.01%     
========================================
  Files         82      82              
  Lines       2662    2663       +1     
  Branches     683     683              
========================================
+ Hits        2545    2546       +1     
  Misses        98      98              
  Partials      19      19
Impacted Files Coverage Δ
packages/webpack/src/config/client.js 98.21% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62a593d...80f72ac. Read the comment docs.

@codecov-io
Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #5729 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##             dev   #5729   +/-   ##
=====================================
  Coverage   95.6%   95.6%           
=====================================
  Files         82      82           
  Lines       2662    2662           
  Branches     683     683           
=====================================
  Hits        2545    2545           
  Misses        98      98           
  Partials      19      19
Impacted Files Coverage Δ
packages/webpack/src/config/base.js 94.94% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62a593d...e6c8d6e. Read the comment docs.

@pi0
Copy link
Member

pi0 commented May 14, 2019

@clarkdo better idea 👍

@clarkdo clarkdo requested a review from pi0 May 14, 2019 17:47
@pi0 pi0 changed the title fix(webpack): resolve correct consola package fix(webpack): resolve consola to latest May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

process is not defined
4 participants