0

I would like to compile files via Vue CLI 4.5 however I want to omit the asset folders like js,css,img,fonts.

This is how my vue.config.js file looks like right now. I tried to change the publicPath and assetsDir with no luck.

module.exports = {
    publicPath:
        process.env.NODE_ENV === "production"
            ? "/newfolder/"
            : "/",
    assetsDir: "static"
}

Vue is trying to load everything from:

newfolder/static/js
newfolder/static/css
newfolder/static/img
newfolder/static/fonts

Is there a way to dump everything into the static folder in my case?

Radical_Activity
  • 2,618
  • 10
  • 38
  • 70
  • You'll need to jump into the [Webpack chain configuration](https://cli.vuejs.org/guide/webpack.html#chaining-advanced) to alter the `output` (for JS) and several rules (`images`, `svg`, `fonts`, etc) to configure the webpack generated file paths. Why do you need / want to do this anyway? – Phil Jan 27 '21 at 01:04
  • Thank you @Phil that sounds like a good way to approach things. I need to do it this way because I have to upload all assets to one endpoint that could not have any subfolders at all. – Radical_Activity Jan 27 '21 at 07:21

0 Answers0