-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added vitejs as a launcher for index.html. package.json #1126
Conversation
…mand is used to create the index.html file to be used with vite
✅ Deploy Preview for xenodochial-hugle-b9ec84 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
No need to build with vite as it was not supposed to be used like this in this project.
The main project use Yarn. Need to add this to my .gitignore file
Thanks for dropping by and adding some vitejs support! However I think the build is failing -- presumably due to this:
seems like maybe either vite needs to be downgraded or we have to upgrade node? |
Didn't think about it. I'm use to always update my package to the last version that I forgot to check the requirement of the project. I will go check for a version compatible with node16. |
Great -- sorry for the difficulty with the build pipeline but its helped me a lot to merge PRs over time safely (even if its running on an outdated version) |
No problem. It's your requirement, so we need to follow them. Currently, i have no problem running it on v16.20.0 I will make sone push while downgrading the version of vitejs till it will compile here without issue. |
gulpfile.js
Outdated
@@ -112,7 +112,7 @@ var buildIndex = function(done) { | |||
|
|||
if (process.env.CI) { | |||
writeFileSync('build/index.html', outputIndex); | |||
copyRecursiveSync('public/assets', 'build/assets'); | |||
copyRecursiveSync('assets', 'build/assets'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I've got a little suggestion from vite at a time telling it will be using files from "assets" instead of public/assets so i reverted back to the original folder.
gah, getting closer :/ |
Removed required engines as it seems the test are done with another lower version
I was using v20.11.0, who was i think compatible with "18.00 || >= 20.0.0" and i've added/used a 16.20.2 after that for the correction. I've taken off the engine requirement in the package. json so it will not be checked during the build tests with google actions. |
Alrighty then, all the checks passed so this is good to go! Thanks for iterating on it @Angra974 :) |
Hi.
Here is some little modification i've done as i don't like to load file with index.html directly ( it will open my text editor more than my browser).
Added vitejs to the package.
Add "prepare" script to package.json to call "gulp fastBuild" when installing the application first time with yarn/pnpm installation.
This will create the build folder and the index.html, file which will be used by vitejs.
Added the script "dev" in the package.json file so vite can be loaded and use index.html file to run the appliccation in our browser.
Change assets folder to /public/assets for convenience with vitejs and modified gulpfile accordingly.
Tests are done and passes without error.