publicPath proprety not working in devServer

  • I want to serve my application on localhost:3001/admin in development environment.
    I put the following config :

            build: {
                scopeHoisting: true,
                vueRouterMode: 'history',
                publicPath: "/admin/" 
            devServer: {
                publicPath: "/admin/", 
                port: 3001,
                proxy: {
                    // proxy all requests starting with /api
                    '/api': {
                        target: 'http://localhost:8080',
                        changeOrigin: true,

    application responds on localhost:3001/admin but failed to load app.js because it looks at localhost:3001/app.js instead of localhost:3001/admin/app.js

  • same problem for me.
    It seems that we can’t set a publicPath during development

Log in to reply