vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.48k stars 4.78k forks source link

Adding vuepress to a project breaks the project's modern build #900

Open archseer opened 5 years ago

archseer commented 5 years ago

Bug report

Adding vuepress to an existing project using this guide https://vuepress.vuejs.org/guide/getting-started.html#inside-an-existing-project breaks the existing project's modern mode build.

Version 0.14.1

Steps to reproduce

https://github.com/archSeer/tsmodern

yarn build --modern

Search for arrowTest inside app.*.js (not .map)

[{key:"arrowTest",value:function(){return function(){}}}]

Now remove vuepress from package.json, run yarn install, then yarn build --modern and it will work correctly again (it will build as an arrow function).

What is expected?

The modern build should work fine, and contain =>

The -legacy and regular bundle should be different sizes, and the regular one should contain arrow functions.

What is actually happening?

Files are almost identical apart from the sourcemap.

-rw-r--r--   1 speed  staff   394K Sep 19 18:49 app-legacy.49d50903.js
-rw-r--r--   1 speed  staff   394K Sep 19 18:50 app.b75421a2.js

I also can't find the arrow function used anywhere in the modern bundle:

$ rg "=>" app.b75421a2.js
(empty)

Other relevant information

archseer commented 5 years ago

The issue was originally opened here https://github.com/vuejs/vue-cli/issues/2609 because I thought it was a vue-cli issue.