Skip to content
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

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

Angra974
Copy link
Contributor

@Angra974 Angra974 commented Feb 6, 2024

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.
image

…mand is used to create the index.html file to be used with vite
Copy link

netlify bot commented Feb 6, 2024

Deploy Preview for xenodochial-hugle-b9ec84 ready!

Name Link
🔨 Latest commit ff6754e
🔍 Latest deploy log https://app.netlify.com/sites/xenodochial-hugle-b9ec84/deploys/65c2ff85719fc3000869d5d6
😎 Deploy Preview https://deploy-preview-1126--xenodochial-hugle-b9ec84.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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
@pcottle
Copy link
Owner

pcottle commented Feb 6, 2024

Thanks for dropping by and adding some vitejs support!

However I think the build is failing -- presumably due to this:

3:47:53 AM: error [email protected]: The engine "node" is incompatible with this module. Expected version "^18.0.0 || >=20.0.0". Got "16.20.2"
3:47:53 AM: error Found incompatible module.

seems like maybe either vite needs to be downgraded or we have to upgrade node?

@Angra974
Copy link
Contributor Author

Angra974 commented Feb 6, 2024

Thanks for dropping by and adding some vitejs support!

However I think the build is failing -- presumably due to this:

3:47:53 AM: error [email protected]: The engine "node" is incompatible with this module. Expected version "^18.0.0 || >=20.0.0". Got "16.20.2"
3:47:53 AM: error Found incompatible module.

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.

@pcottle
Copy link
Owner

pcottle commented Feb 6, 2024

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)

@Angra974
Copy link
Contributor Author

Angra974 commented Feb 6, 2024

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

image
image
image

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');
Copy link
Owner

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?

Copy link
Contributor Author

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.

@pcottle
Copy link
Owner

pcottle commented Feb 6, 2024

0.478 error [email protected]: The engine "node" is incompatible with this module. Expected version "16.20.2". Got "14.20.0"
0.486 error Found incompatible module.
0.486 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-

gah, getting closer :/

Removed required engines as it seems the test are done with another lower version
@Angra974
Copy link
Contributor Author

Angra974 commented Feb 7, 2024

0.478 error [email protected]: The engine "node" is incompatible with this module. Expected version "16.20.2". Got "14.20.0"
0.486 error Found incompatible module.
0.486 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-

gah, getting closer :/
Tell me exactly which version of node you need for the setup.

image

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.

@pcottle pcottle merged commit de070be into pcottle:main Feb 7, 2024
5 checks passed
@pcottle
Copy link
Owner

pcottle commented Feb 7, 2024

Alrighty then, all the checks passed so this is good to go! Thanks for iterating on it @Angra974 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants