vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.76k stars 6.33k forks source link

Variable inside config replaced with static imported and resolved value after vue add someplugin #5034

Open 7iomka opened 4 years ago

7iomka commented 4 years ago

Version

4.1.2

Environment info

System:
    OS: macOS 10.15.2
    CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
  Binaries:
    Node: 11.13.0 - /usr/local/bin/node
    Yarn: 1.17.3 - ~/.npm-global/bin/yarn
    npm: 6.13.2 - ~/.npm-global/bin/npm
  Browsers:
    Chrome: 80.0.3987.16
    Firefox: 70.0.1
    Safari: 13.0.4
  npmPackages:
    @ckeditor/ckeditor5-vue: ^1.0.1 => 1.0.1 
    @kazupon/vue-i18n-loader: ^0.3.0 => 0.3.0 
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app:  4.1.1 
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  4.1.1 
    @vue/cli-plugin-babel: ^4.1.0 => 4.1.1 
    @vue/cli-plugin-eslint: ^4.1.0 => 4.1.1 
    @vue/cli-plugin-router: ^4.1.0 => 4.1.1 
    @vue/cli-plugin-vuex: ^4.1.0 => 4.1.1 
    @vue/cli-service: ^4.1.0 => 4.1.1 
    @vue/cli-shared-utils:  4.1.1 
    @vue/component-compiler-utils:  3.0.2 
    @vue/eslint-config-airbnb: ^4.0.0 => 4.0.1 
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/web-component-wrapper:  1.2.0 
    bootstrap-vue: ^2.1.0 => 2.1.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.3 
    portal-vue:  2.1.6 
    vue: ^2.6.10 => 2.6.10 
    vue-cli-plugin-i18n: ^0.6.0 => 0.6.0 
    vue-cli-plugin-style-resources-loader: ^0.1.4 => 0.1.4 
    vue-dompurify-html: ^2.1.1 => 2.1.1 
    vue-eslint-parser:  5.0.0 
    vue-force-next-tick: ^1.0.3 => 1.0.3 
    vue-functional-data-merge:  3.1.0 
    vue-hot-reload-api:  2.3.4 
    vue-i18n: ^8.0.0 => 8.15.3 
    vue-i18n-extract:  0.4.14 
    vue-i18n-ts:  0.1.0 
    vue-loader:  15.7.2 
    vue-router: ^3.1.3 => 3.1.3 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vue-unique-id: ^2.0.0 => 2.0.0 
    vuex: ^3.1.2 => 3.1.2 
    vuex-router-sync: ^5.0.0 => 5.0.0 
  npmGlobalPackages:
    @vue/cli: 4.1.1

Steps to reproduce

import some variable in vue.config.js and use it in configuration in which changes are made after installing the some plugin

What is expected?

imported variable will note be changed

What is actually happening?

variable will be replaced with static imported and resolved value!


image

LinusBorg commented 4 years ago

import some variable in vue.config.js and use it in configuration in which changes are made after installing the some plugin

I don't understand what that means.

Please provide a valid, runnable reproduction as is required in our issue guidelines.

7iomka commented 4 years ago

import some variable in vue.config.js and use it in configuration in which changes are made after installing the some plugin

I don't understand what that means.

Please provide a valid, runnable reproduction as is required in our issue guidelines.

https://codesandbox.io/s/ecstatic-morning-jk4le I don't know if codesandbox supporting terminal commands and how to run it, but, download this demo project, and try to instal plugin vue add i18n you will se in vue.config.js that

patterns: scssResources

will be replaced with

patterns: [
absoulteResolvedPathToFile,
...,
]

I dont know why, but this happens when installed plugin add some configuration in vue.config.js