question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgraded vue-jest to vue2-jest for Jest 27+ and got a 10KB bundle increase

See original GitHub issue

We updated Jest to 27.x.x and switched to vue2-jest. We noticed our bundle increased quite a bit (10KB on zipped/minified) because a list of dependencies seems to be added to our bundle because of vue2-jest.

"@babel/code-frame@^7.16.7"
"@babel/generator@^7.16.7"
"@babel/helper-environment-visitor@^7.16.7"
"@babel/helper-function-name@^7.16.7"
"@babel/helper-get-function-arity@^7.16.7"
"@babel/helper-hoist-variables@^7.16.7"
"@babel/helper-module-imports@^7.16.7"
"@babel/helper-module-transforms@^7.16.7"
"@babel/helper-plugin-utils@^7.16.7"
"@babel/helper-simple-access@^7.16.7"
"@babel/helper-split-export-declaration@^7.16.7"
"@babel/helper-validator-identifier@^7.16.7"
"@babel/highlight@^7.16.7"
"@babel/parser@^7.16.7"
"@babel/plugin-transform-modules-commonjs@^7.2.0"
"@babel/traverse@^7.16.7"

… and more.

all these end up in our production bundle.

is the above accurate, or are we doing something wrong? Naturally, @vue/vue2-jest is in devDependencies.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LinusBorgcommented, Jan 10, 2022

I don’t see any way those dependencies could end up in your production bundle unless you (or something in your build process) imports them. - and vue-jest is not part of that build process, presumably - being a testing library only.

I don’t think we can say much here with zero knowledge of your project’s build setup.

0reactions
LinusBorgcommented, Jan 11, 2022

I don’t see how

Read more comments on GitHub >

github_iconTop Results From Across the Web

@vue/vue2-jest - npm
Start using @vue/vue2-jest in your project by running `npm i ... Add a README to your package so that users know how to...
Read more >
@vue/vue2-jest | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Jest 27: New Defaults for Jest, 2021 edition
We will explain those changes of defaults and other notable breaking changes in this post, but first, let's get into some exciting new...
Read more >
Writing multiple Vue components in a single file
Booking description should be a tiny component that just gets stuff ... adds the Vue template compiler to your bundle… which is around...
Read more >
Jest don't mount composition-api component on Vue 2.7 + TS ...
SyntaxError: Unexpected token (1:1141) at Parser.pp$4.raise (node_modules/vue-template-es2015-compiler/buble.js:2757:13) at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found