Skip to content

Make public folder path configurable #3184

@marvinrabe

Description

@marvinrabe

What problem does this feature solve?

Renaming or moving the public folder in order to use vue-cli alongside other frameworks (e.g. Laravel).

Yes, it is possible to achieve it with this configuration:

const path = require('path')

const publicDir = 'assets/html';

module.exports = {
    chainWebpack: config => {
        config
            .plugin('html')
            .tap(args => {
                args[0].template = path.resolve(publicDir + '/index.html');
                return args
            })

        config
            .plugin('copy')
            .tap(([pathConfigs]) => {
                pathConfigs[0].from = path.resolve(publicDir);
                return [pathConfigs]
            })
    }
}

But for such a simple configuration this feels ridiculous.

What does the proposed API look like?

Specify the public directory path in the vue.config.js

module.exports = {
    publicDir: 'assets/html' // Defaults to 'public'
}

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