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

index.html resetting when running npm start #308

Closed
timmshinbone opened this issue Jul 1, 2021 · 2 comments
Closed

index.html resetting when running npm start #308

timmshinbone opened this issue Jul 1, 2021 · 2 comments

Comments

@timmshinbone
Copy link

A friend of mine is using this template and I've been trying to help him out, but we're both stuck. Basically, running npm start is replacing all of the changed files in dist/ with the files in src/, I get that this is how the template compiles them when it runs the clean script, but it's completely replacing the index.html code with the template code in index.pug and all of the changes are overwritten in the text editor, even the added image files are removed.

Do we have to update the index.pug file at all or update the scripts? We really can't figure this out since the template's readme just says to add code in the index.html. Are we missing a step somewhere?

@davidtmiller
Copy link
Member

If you're not using the source files for development, you don't need to be running and of the npm scripts. You could take the dist directory and use those as-is if you'd just like to work with HTML/CSS, but if you want to work with SASS and Pug, modify the files in src and then run the npm start scripts.

When the script is run, the HTML is built from the Pug, so the index.pug is replacing whatever is in the index.html file in the dist directory. Hopefully this helps!

@CWJWANJING
Copy link

Hi, I still don't understand how to solve this problem. I tried to disable running 'clean.js' but can't find where it was called. And I don't understand how we can just use 'dist' and not src? Any help please? Thanks a lot!!

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

No branches or pull requests

3 participants