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

vue-cli-service build --mode produce different directory structure #4215

Closed
varna opened this issue Jul 1, 2019 · 4 comments · Fixed by #4323
Closed

vue-cli-service build --mode produce different directory structure #4215

varna opened this issue Jul 1, 2019 · 4 comments · Fixed by #4323

Comments

@varna
Copy link

varna commented Jul 1, 2019

Version

3.8.4

Reproduction link

https://codesandbox.io/s/vue-cli-n3let

Environment info

  System:
    OS: macOS 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 10.9.0 - ~/.nvm/versions/node/v10.9.0/bin/node
    Yarn: 1.12.1 - /usr/local/bin/yarn
    npm: 6.9.2 - ~/.nvm/versions/node/v10.9.0/bin/npm
  Browsers:
    Chrome: 75.0.3770.100
    Firefox: 67.0
    Safari: 12.1.1
  npmPackages:
    @casl/vue: ^0.5.1 => 0.5.1 
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0 
    @vue/babel-preset-app:  3.7.0 
    @vue/babel-preset-jsx:  1.0.0 
    @vue/babel-sugar-functional-vue:  1.0.0 
    @vue/babel-sugar-inject-h:  1.0.0 
    @vue/babel-sugar-v-model:  1.0.0 
    @vue/babel-sugar-v-on:  1.0.0 
    @vue/cli-overlay:  3.7.0 
    @vue/cli-plugin-babel: ^3.5.5 => 3.7.0 
    @vue/cli-plugin-e2e-nightwatch: ^3.4.0 => 3.7.0 
    @vue/cli-plugin-eslint: ^3.4.0 => 3.7.0 
    @vue/cli-plugin-pwa: ^3.4.0 => 3.7.0 
    @vue/cli-plugin-unit-jest: ^3.5.3 => 3.7.0 
    @vue/cli-service: ^3.5.3 => 3.7.0 
    @vue/cli-shared-utils:  3.7.0 
    @vue/component-compiler-utils:  2.6.0 
    @vue/eslint-config-prettier: ^4.0.1 => 4.0.1 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/test-utils: ^1.0.0-beta.29 => 1.0.0-beta.29 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue:  4.7.1 
    jest-serializer-vue:  2.0.2 
    vue: ^2.6.10 => 2.6.10 
    vue-cli-plugin-vuetify: ^0.5.0 => 0.5.0 
    vue-eslint-parser:  2.0.3 
    vue-google-signin-button: ^1.0.2 => 1.0.2 
    vue-hot-reload-api:  2.3.3 
    vue-i18n: ^8.10.0 => 8.11.2 
    vue-inheritance-loader: ^0.1.5 => 0.1.5 
    vue-jest:  3.0.4 
    vue-loader:  15.7.0 
    vue-observe-visibility:  0.4.3 
    vue-resize:  0.4.5 
    vue-router: ^3.0.3 => 3.0.6 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.10 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
    vue-virtual-scroll-list: ^1.3.3 => 1.3.7 
    vue-virtual-scroller: ^1.0.0-rc.2 => 1.0.0-rc.2 
    vue2-google-maps: ^0.10.2 => 0.10.6 
    vuetify: ^1.5.11 => 1.5.14 
    vuetify-loader: ^1.2.0 => 1.2.2 
    vuex: ^3.0.1 => 3.1.1 
    vuex-persist: ^2.0.0 => 2.0.0 
  npmGlobalPackages:
    @vue/cli: 3.8.4

Steps to reproduce

yarn build-dev

What is expected?

Producing dist folder with js folder inside of it.

What is actually happening?

Produced dist folder with .js files inside of it. (JS files are ending up in dist folder instead of dist/js.


Adding flag --mode with any values produces same result (i.e. vue-cli-service build --mode staging).

@varna
Copy link
Author

varna commented Jul 1, 2019

Similar issue: #3613

@wangchaofan
Copy link

add 'NODE_ENV=production' to .env.staging

haoqunjiang added a commit that referenced this issue Jul 21, 2019
BREAKING CHANGE:
Changing directory strcuture, though now becoming more intuitive, may
still break users' workflows, so it's considered a breaking change.

Fixes #4215.
Fixes #3767.
Fixes #4234
@ppshobi
Copy link

ppshobi commented Dec 21, 2019

Same problem again.

my vue.config

module.exports = {
  publicPath: '/',
  outputDir:'templates/',
  assetsDir: '../static/',
  transpileDependencies: [
    'vue-echarts',
    'resize-detector'
  ],
  configureWebpack: {
    optimization: {
      splitChunks: {
        chunks: 'all'
      }
    },
  },
}

running vue-cli-service build put files in the appropriate locations, but vue-cli-service build --mode development put all the files (the index.html and the js files inside the templates folder instead of static folder)

@aryaroudi
Copy link

add 'NODE_ENV=production' to .env.staging

it doesn't work for library target, it still putting all the js file directly in the dist folder!

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

Successfully merging a pull request may close this issue.

4 participants