Closed bekalshenoy closed 4 years ago
The build command has a option assetsDir
,maybe can help you.
No, I Have package.json
In Public Folder, To Use In Build. I Use This package.json
To Build Electron Application. I Can Use A Node Script To Do This( Running Script Containing fs
After vite build
) But It Would Be Cleaner And I Can Use A Modified package.json
Instead Of Copying, If Have A Option To Change Path Of Public Folder In Build.
Look like this case isn't relate of vite
build.Can you explain in detail with the publicDir
intention for vite
build.I'm not sure get it.
In Vue cli Content Inside Public Folder Will Go To dist\
But In Vite It Is In dist\public\
. I Want Vue cli Behavior Here.
If you import it as /public/
in your code, then the directory should be copied to the exact same location in the dist
dir, otherwise the paths will be incorrect. It is intentional to make this not configurable.
@yyx990803
Laravel uses the public/
directory as the folder it serves from, by not making the public path configurable, this means Vite will never work with Laravel. Unless I'm misunderstanding something?
My outDir must be set to public
or built files won't be accessible on the frontend, but this throws an error
Error: Source and destination must not be the same.
at C:\Users\harry\Sites\vite-laravel\node_modules\vite\node_modules\fs-extra\lib\util\stat.js:39:17
at cb (util.js:196:39)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Which is understandable, but being able to rename vite's public folder would then enable this to work?
Nevermind, changing the root
config option allowed me to shift this into a separate folder. Sorry about that.
Is your feature request related to a problem? Please describe. I Want Content Of
public
In Root Ofdist
Instead Of In Public Folder Insidedist
.Describe the solution you'd like Add An Option To Configure
publicDir
Relative TooutDir
.Describe alternatives you've considered Instead Of Creating Public Folder In
dist
Add It's Content Todist
.