Skip to content

"vue-cli-service build --watch" on production mode does not remove some old build files #6182

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

Open
JudgedPluto opened this issue Jan 4, 2021 · 0 comments

Comments

@JudgedPluto
Copy link

Version

4.5.9

Environment info

System:
    OS: Windows 10 10.0.19041
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Binaries:
    Node: 12.18.3 - E:\NodeJS\node.EXE
    Yarn: Not Found
    npm: 6.14.6 - E:\NodeJS\npm.CMD
Browsers:
    Chrome: Not Found
    Edge: Spartan (44.19041.1.0), Chromium (87.0.664.66)
npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.0-rc.2
    @vue/babel-plugin-jsx:  1.0.0-rc.5
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  4.5.9
    @vue/babel-preset-jsx:  1.2.4
    @vue/babel-sugar-composition-api-inject-h:  1.2.1
    @vue/babel-sugar-composition-api-render-instance:  1.2.4
    @vue/babel-sugar-functional-vue:  1.2.2
    @vue/babel-sugar-inject-h:  1.2.2
    @vue/babel-sugar-v-model:  1.2.3
    @vue/babel-sugar-v-on:  1.2.3
    @vue/cli-overlay:  4.5.9
    @vue/cli-plugin-babel: ~4.5.0 => 4.5.9
    @vue/cli-plugin-eslint: ~4.5.0 => 4.5.9
    @vue/cli-plugin-router:  4.5.9
    @vue/cli-plugin-vuex:  4.5.9
    @vue/cli-service: ~4.5.0 => 4.5.9
    @vue/cli-shared-utils:  4.5.9
    @vue/compiler-core:  3.0.4
    @vue/compiler-dom:  3.0.4
    @vue/compiler-sfc: ^3.0.0 => 3.0.4
    @vue/compiler-ssr:  3.0.4
    @vue/component-compiler-utils:  3.2.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/reactivity:  3.0.4
    @vue/runtime-core:  3.0.4
    @vue/runtime-dom:  3.0.4
    @vue/shared:  3.0.4
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^7.0.0-0 => 7.3.0
    vue: ^3.0.0 => 3.0.4
    vue-eslint-parser:  7.3.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.9.6 (16.1.2)
    vue-style-loader:  4.1.2
    vue-template-es2015-compiler:  1.9.1
npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Create a Vue 3 Project: vue create app-name
  2. Build the project: vue-cli-service build --mode production --watch
  3. Modify the project code and save.

What is expected?

Old build files must be removed and new build files will be added.

What is actually happening?

Although the files are rebuilt and added to the build folder, some old build files are not removed from the build folder.


Some notes to add:

  1. Adding --watch option will always switch to development mode, so --mode option will be needed for production build.
  2. Here are the list of files generated from a sample project, before and after modifying the project code: dir /s /b

Before:

E:\Vue3\app-bug\dist\css
E:\Vue3\app-bug\dist\favicon.ico
E:\Vue3\app-bug\dist\img
E:\Vue3\app-bug\dist\index.html
E:\Vue3\app-bug\dist\js
E:\Vue3\app-bug\dist\css\app.fb0c6e1c.css
E:\Vue3\app-bug\dist\img\logo.82b9c7a5.png
E:\Vue3\app-bug\dist\js\app.26359725.js
E:\Vue3\app-bug\dist\js\app.26359725.js.map
E:\Vue3\app-bug\dist\js\chunk-vendors.530cb5a2.js
E:\Vue3\app-bug\dist\js\chunk-vendors.530cb5a2.js.map

After:

E:\Vue3\app-bug\dist\css
E:\Vue3\app-bug\dist\favicon.ico
E:\Vue3\app-bug\dist\img
E:\Vue3\app-bug\dist\index.html
E:\Vue3\app-bug\dist\js
E:\Vue3\app-bug\dist\css\app.fb0c6e1c.css
E:\Vue3\app-bug\dist\img\logo.82b9c7a5.png
E:\Vue3\app-bug\dist\js\app.26359725.js
E:\Vue3\app-bug\dist\js\app.26359725.js.map
E:\Vue3\app-bug\dist\js\app.d740d19f.js
E:\Vue3\app-bug\dist\js\app.d740d19f.js.map
E:\Vue3\app-bug\dist\js\chunk-vendors.530cb5a2.js
E:\Vue3\app-bug\dist\js\chunk-vendors.530cb5a2.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant