Skip to content

Cannot add multiple static options for devServer #7145

@VasekProchazka

Description

@VasekProchazka

Version

5.0.4

Environment info

  System:
    OS: macOS 12.3
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 14.19.0 - ~/.nvm/versions/node/v14.19.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v14.19.0/bin/yarn
    npm: 6.14.16 - ~/.nvm/versions/node/v14.19.0/bin/npm
  Browsers:
    Chrome: 101.0.4951.64
    Edge: Not Found
    Firefox: Not Found
    Safari: 15.4
  npmPackages:
    @vue/cli-plugin-babel: ^5.0.4 => 5.0.4 
    @vue/cli-plugin-unit-jest: ^4.5.17 => 4.5.17 
    @vue/cli-service: ^5.0.4 => 5.0.4 
    @vue/composition-api: ~1.6.1 => 1.6.1 
    @vue/test-utils: ~1.3.0 => 1.3.0 
    eslint-plugin-vue: ^8.4.1 => 8.7.1 
    jest-serializer-vue-tjw: ~3.19.0 => 3.19.0 
    vue: ^2.6.14 => 2.6.14 
    vue-date-filter: ^1.0.1 => 1.0.1 
    vue-jest: ~3.0.7 => 3.0.7 
    vue-svg-loader: ^0.16.0 => 0.16.0 
    vue-template-compiler: ^2.6.14 => 2.6.14 
    vuex: ^3.6.2 => 3.6.2 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Add array to static.

module.exports = {
  configureWebpack: {
    devServer: {
      static: [
        {
          directory: `dist/css`,
          publicPath: "/css",
        },
      ],
    },
  },
}

What is expected?

on devServer, the static option should accept array. By code from file @vue/cli-service/lib/commands/serve.js (201-207 lines), this case cannot happen.

static: [
  {
    directory: `/dir`,
    publicPath: "/css",
  },
] 

It should merge default static settings from ci or rewrite it. None of it happened.

What is actually happening?

By your code, this is result of using array in static option

{
  '0': {
    directory: '/dir',
    publicPath: '/css'
  },
  directory: '/public',
  publicPath: '/fe',
  watch: true
}

Now, I cannot added more than one static settings to webpack configuration

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy