Closed markmckimbv closed 1 year ago
Apologies if i've missed something obvious, but I'm having issues serving a JSON file from the public dir while running the dev server.
I understand that the files are not physically copied when running the dev server, but my assumption is that they are still accessible.
viteStaticCopy({ targets: [ { src: '../../libs/my-lib/translations/en-US/translations.json', dest: './' } ] })
Trying to access the file (via browser) on: http://localhost:8080/translations.json and getting a 404.
http://localhost:8080/translations.json
I've tried multiple different values for dest including:
dest
./
/
public
/public
./public
apps/my-app/public
/apps/my-app/public
Nothing seems to work.
I can see that it is finding the file in question: [vite-plugin-static-copy] Collected 1 items.
[vite-plugin-static-copy] Collected 1 items.
Am I missing something? Thanks in advance!
Nevermind - Mistake on my part. I had structured set to true which was preventing it from working as expected.
structured
true
Got it working. Thanks anyway!
Apologies if i've missed something obvious, but I'm having issues serving a JSON file from the public dir while running the dev server.
I understand that the files are not physically copied when running the dev server, but my assumption is that they are still accessible.
Trying to access the file (via browser) on:
http://localhost:8080/translations.json
and getting a 404.I've tried multiple different values for
dest
including:./
/
public
/public
./public
apps/my-app/public
/apps/my-app/public
Nothing seems to work.
I can see that it is finding the file in question:
[vite-plugin-static-copy] Collected 1 items.
Am I missing something? Thanks in advance!