1

I'm working on a portfolio in Vue.js. I added a button that allows the user to download a copy of my resume (a PDF file). The button works great in development. The file is in my public folder, which is supposed to be the static directory where all files are copied to the dist folder from. When I run the command vue build, the only thing copied from that folder is the index.html page. I have tried adding images to that folder and they are also not being copied over. My vue.config.js file looks like this:

module.exports = {
    publicPath: '.'
};

So the relative paths are correct for the deployed files.

I have a similar setup working perfectly fine at my job, with the same version of Vue and vue-cli-service (both 6.14.11). I'm relatively new to Vue so any help would be greatly appreciated.

Edit: I've also noticed that even though I changed the <title> tag in public/index.html to "James Bell's Portfolio", the title in the production code is "Vue CLI App".

Here's the github repo: https://github.com/jamesthedev/portfolio

4
  • I can't reproduce the problem (Node 15, npm 7.4.0, macOS BigSur). Also, there's no version of vue or @vue/cli that is 6.4.11. You must be thinking of the npm version. Can you share a link to a reproduction? Commented Jun 29, 2021 at 0:35
  • Can you share your pacakag.json and the location of the public folder in your project structure? Commented Jun 29, 2021 at 1:13
  • Also, this is a good resource which could help: cli.vuejs.org/guide/… Commented Jun 29, 2021 at 1:13
  • github.com/jamesthedev/portfolio Here's the github repo. You should be able to see the package.json from there. The public folder is at the root directory, so the same as the src folder Commented Jun 29, 2021 at 14:06

1 Answer 1

0

I figured it out! I was running vue build from the src folder. I needed to run vue-cli-service build from the root directory. Once I did that, all my static assets were copied to dist.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.