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

The js file in the public folder is incorrectly converted #6699

Closed
zj9495 opened this issue Sep 17, 2021 · 1 comment · Fixed by #6700
Closed

The js file in the public folder is incorrectly converted #6699

zj9495 opened this issue Sep 17, 2021 · 1 comment · Fixed by #6700
Labels

Comments

@zj9495
Copy link
Contributor

zj9495 commented Sep 17, 2021

Version

5.0.0-beta.4

Reproduction link

github.com

Environment info

Environment Info:

  System:
    OS: macOS 11.5.2
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 15.9.0 - ~/.nvm/versions/node/v15.9.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.19.1 - ~/.nvm/versions/node/v15.9.0/bin/npm
  Browsers:
    Chrome: 93.0.4577.82
    Edge: 93.0.961.47
    Firefox: 91.0.2
    Safari: 14.1.2
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.0.7
    @vue/babel-plugin-transform-vue-jsx:  1.2.1
    @vue/babel-preset-app:  5.0.0-beta.4
    @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:  5.0.0-beta.4
    @vue/cli-plugin-babel: ~5.0.0-beta.4 => 5.0.0-beta.4
    @vue/cli-plugin-eslint: ~5.0.0-beta.4 => 5.0.0-beta.4
    @vue/cli-plugin-router:  5.0.0-beta.4
    @vue/cli-plugin-vuex:  5.0.0-beta.4
    @vue/cli-service: ~5.0.0-beta.4 => 5.0.0-beta.4
    @vue/cli-shared-utils:  5.0.0-beta.4
    @vue/component-compiler-utils:  3.2.2
    @vue/web-component-wrapper:  1.3.0
    eslint-plugin-vue: ^7.6.0 => 7.17.0
    vue: ^2.6.14 => 2.6.14
    vue-eslint-parser:  7.11.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  16.5.0 (15.9.8)
    vue-style-loader:  4.1.3
    vue-template-compiler: ^2.6.14 => 2.6.14
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. git clone git@github.com:zj9495/vue-cli5-public-folder-issue.git
  2. yarn build
  3. compare the config.js files in the dist and public folders

What is expected?

the config.js file in the public folder should be copied to the dist folder as it is

What is actually happening?

The content of config.js is converted to void 0;
https://github.com/zj9495/vue-cli5-public-folder-issue/blob/master/public/config.js
https://github.com/zj9495/vue-cli5-public-folder-issue/blob/master/dist/config.js


It only happened in @vue/cli 5

@zj9495 zj9495 changed the title The js file in the public folder will be converted incorrectly The js file in the public folder is incorrectly converted Sep 17, 2021
@fangbinwei fangbinwei added the bug label Sep 17, 2021
@fangbinwei
Copy link
Collaborator

fangbinwei commented Sep 17, 2021

It seems config.js was minimized by terser-webpack-plugin

can be fixed by this option

webpack-contrib/copy-webpack-plugin#576

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 a pull request may close this issue.

2 participants