vue 'public' files not included after webpack

Viewed 179

I have a set of files in the public folder of my vue-js app and I'm expecting them to be copied over into the wwwroot folder when the project is built, per this information in the docs:

Any static assets placed in the public folder will simply be copied and not go through webpack. You need to reference them using absolute paths. (ref)

The files are favicon.ico and other favicon pngs of various sizes, as well as a site.webmanifest. I'm not referencing these in any code, other than using the example provided (to the best of my knowledge) referencing them in the index.html:

<link rel="apple-touch-icon" sizes="180x180" href="<%= BASE_URL %>apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<%= BASE_URL %>favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<%= BASE_URL %>favicon-16x16.png">
<link rel="manifest" href="<%= BASE_URL %>site.webmanifest">

How do I get these to be copied to the base of my generated site when I build? All the directly referenced assets are included (css, fonts, etc.), but none of the static files in public except index.html itself.

For reference, in case it's applicable, here's my vue.config.js:

const path = require("path");

module.exports = {
    outputDir: path.resolve(__dirname, "./wwwroot"),
    chainWebpack: (config) => {
        config
            .plugin('html')
            .tap((args) => {
                args[0].template = './ClientApp/public/index.html'
                return args
            })

        config.entry("app")
            .clear()
            .add("./ClientApp/src/main.js")
            .end()

        config.resolve.alias
            .set("@", path.join(__dirname, "./ClientApp"))
    }
}

I'm sure I'm overlooking something - thanks for any assistance.

0 Answers
Related