Skip to content

assetsPath config option ignored when building with --watch  #3767

Closed
@halfpastfive

Description

@halfpastfive

Version

3.5.5

Reproduction link

https://github.com/halfpastfive/assetspath

Environment info


Environment Info:

  System:
    OS: Linux 4.18 KDE neon 5.15
    CPU: (8) x64 Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz
  Binaries:
    Node: 10.15.3 - /usr/bin/node
    Yarn: Not Found
    npm: 6.4.1 - /usr/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: 66.0.2
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.3 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.3 
    @vue/babel-preset-app:  3.5.5 
    @vue/babel-preset-jsx:  1.0.0-beta.3 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.3 
    @vue/babel-sugar-inject-h:  1.0.0-beta.3 
    @vue/babel-sugar-v-model:  1.0.0-beta.3 
    @vue/babel-sugar-v-on:  1.0.0-beta.3 
    @vue/cli-overlay:  3.5.1 
    @vue/cli-plugin-babel: ^3.5.0 => 3.5.5 
    @vue/cli-plugin-eslint: ^3.5.0 => 3.5.1 
    @vue/cli-service: ^3.5.0 => 3.5.3 
    @vue/cli-shared-utils:  3.5.1 
    @vue/component-compiler-utils:  2.6.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 
    vue: ^2.6.6 => 2.6.10 
    vue-eslint-parser:  2.0.3 
    vue-hot-reload-api:  2.3.3 
    vue-loader:  15.7.0 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: 3.5.5

Steps to reproduce

in the example project, outputDir and assetsDir are defined in vue.config.js

  1. build the project with npm run build and browse the web directory: js files are copied in the assets/ subdirectory

  2. build the project with npm run watch (which is only an alias for vue-cli-service build --watch in the package.json) and browse the web directory: js files are copied at the root of the directory, ignoring the assetsPath option of the vue.config.js

What is expected?

assets are copied in the directory defined by the assetsPath option from the vue.config.js file

What is actually happening?

assets are copied in the directory defined by the outputPath directory, ignoring the assetsPath option


In my real-world use case, the html files are templates for a server-side application. In this application, assets need to be in a subfolder in order to be considered as assets by our server.

Without it, I need to build for production, making debugging more difficult.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions