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: bundle resources other than js(x)/json in node_modules #4913

Merged
merged 3 commits into from Feb 1, 2019

Conversation

Projects
None yet
6 participants
@clarkdo
Copy link
Collaborator

clarkdo commented Jan 31, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Fix #4060

Disable webpack-node-externals for resources which are not js/jsx/json, like: images, fonts or videos

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@clarkdo clarkdo requested review from manniL and pi0 Jan 31, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 31, 2019

Codecov Report

Merging #4913 into dev will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #4913      +/-   ##
==========================================
+ Coverage   91.71%   91.79%   +0.08%     
==========================================
  Files          73       73              
  Lines        2414     2414              
  Branches      594      594              
==========================================
+ Hits         2214     2216       +2     
+ Misses        182      180       -2     
  Partials       18       18
Impacted Files Coverage Δ
packages/webpack/src/config/server.js 100% <ø> (ø) ⬆️
packages/vue-renderer/src/renderer.js 95.65% <0%> (+1.08%) ⬆️

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 569b6aa...98934bb. Read the comment docs.

@manniL

This comment has been minimized.

Copy link
Member

manniL commented Jan 31, 2019

Do we need to include ts/tsx as well?

@clarkdo

This comment has been minimized.

Copy link
Collaborator Author

clarkdo commented Jan 31, 2019

ts needs to be transpiled by ts-loader, maybe should exclude when use ts-node.

But we cannot make sure that user will use same distribution in building and start.

For example, if user built bundles with nuxt-ts and start with nuxt, the ts files still need to be transpiled, so I think current config is proper

@Atinux

This comment has been minimized.

Copy link
Member

Atinux commented Jan 31, 2019

I may have some doubts about this, since Vue is actually having this rule as well, may be worth asking Vue team too

@clarkdo

This comment has been minimized.

Copy link
Collaborator Author

clarkdo commented Jan 31, 2019

It's for server side bundle, does vue have same case ?

For example, user imports fonts or images from node_modules, it doesn't work for ssr since we make them as externals.

@pi0

pi0 approved these changes Jan 31, 2019

@pi0

This comment has been minimized.

Copy link
Member

pi0 commented Jan 31, 2019

I agree about this change since:

  1. Server bundle should only contains js/json
  2. Other resources should be whitelisted to their reference be correctly resolved
@galvez

galvez approved these changes Feb 1, 2019

@Atinux Atinux self-requested a review Feb 1, 2019

@Atinux

Atinux approved these changes Feb 1, 2019

@manniL

manniL approved these changes Feb 1, 2019

@clarkdo clarkdo merged commit 268851f into nuxt:dev Feb 1, 2019

10 checks passed

Semantic Pull Request ready to be squashed
Details
[ci.azure] nuxt.js #20190201.21 succeeded
Details
ci/circleci: audit Your tests passed on CircleCI!
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: lint-app Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test-e2e Your tests passed on CircleCI!
Details
ci/circleci: test-types Your tests passed on CircleCI!
Details
ci/circleci: test-unit Your tests passed on CircleCI!
Details

clarkdo added a commit that referenced this pull request Feb 18, 2019

@pi0 pi0 referenced this pull request Feb 25, 2019

Closed

chore(release): v2.4.4 #5109

@pi0 pi0 referenced this pull request Mar 14, 2019

Merged

v2.5.0 #5237

@clarkdo clarkdo deleted the clarkdo:bundle-font branch Apr 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.