Menu icon Foundation
f4a: npm start not picking up all changes

From the docs, it sounds like all you need to do is run `npm start` (or `foundation-apps watch`; not sure what the difference is…), and all changes you make to your code will get picked up, and the files in the `build` folder will be updated such that all you need to do is refresh the page in your browser, and all your changes will be there.

But it doesn't seem like this is actually the case. For example, if I create a new file in the `client/templates` directory, it does not get picked up—no files are copied.

And if I make a change in `index.html`, stuff gets copied, but only things that have been *changed*. My new file is still not copied.

Ctrl-C'ing and running `npm start` again *does* pick up the new file.

Is this the way it's supposed to work? Am I doing something wrong?

foundation for appsf4a

From the docs, it sounds like all you need to do is run `npm start` (or `foundation-apps watch`; not sure what the difference is…), and all changes you make to your code will get picked up, and the files in the `build` folder will be updated such that all you need to do is refresh the page in your browser, and all your changes will be there.

But it doesn't seem like this is actually the case. For example, if I create a new file in the `client/templates` directory, it does not get picked up—no files are copied.

And if I make a change in `index.html`, stuff gets copied, but only things that have been *changed*. My new file is still not copied.

Ctrl-C'ing and running `npm start` again *does* pick up the new file.

Is this the way it's supposed to work? Am I doing something wrong?

Jacob Brooks almost 4 years ago

No, that is not how it should work. From my experience so far with Foundation for Apps, running "foundation-apps watch" works better. I read a couple forum posts and I am still a bit confused myself what the difference is. That being said, it looked like you were, but are you working from the Client folder?

I have been working with mine and as soon as I save it, I can refresh the browser and the changes are live. If I add a new partial/route, it gets added to the routes.js file in the Build folder so I am not quite sure what is happening in your case. Are you sure you had no errors on install and when you save, can you see any updates in your terminal/cmd line? You should see some text about what changed and what was updated.

If you arent seeing the updates in your Terminal/Cmd Line, there is probably an error in your build somewhere. I know this might not help a lot, but I thought I could shine some light on a few things for you.

Good luck and let me know if you need anything else and I will help if possible.

Adrian P almost 4 years ago

I too experience the same issue.. change index.html and file is copied... add a file to the templates folder and the file is not copied.
I am using the foundation-apps watch command.

Note: Using Windows 7 and did experience some installation issues similar to those detailed in other posts... these are now resolved.

Martin Polley almost 4 years ago

Running foundation-apps watch in the client folder fails. (It can't find package.json, which is in the parent folder.) So I'm running it in the main folder (the one that contains the client and build folders).

Adding a new template results in no new output in terminal. In contrast, saving a change to index.html gives me "Starting 'copy'..." and "Finished 'copy'"... in terminal.

I ran bower update, but the behavior is the same as it was before. The new template file is not copied, and routes.js is not updated to include the new route.

It's not a big deal to work around this once you understand what is happening. But it seems to me that it should pick up new files and act accordingly...

Rafi Benkual almost 4 years ago

They both accomplish the same thing. You can use either foundation-apps watch or npm start

Aidil Goh almost 4 years ago

Had the same issue when creating new templates.

Here's what got my new html files copied into build:

Open gulpfile.js and edit the line that watches Angular templates to be:

 // Watch Angular templates
  gulp.watch(['client/templates/**/*.html'], ['copy-templates']);

credit:
https://github.com/blacklizard/foundation-apps/blob/gulp-detect-new-template/gulpfile.js

Martin Polley almost 4 years ago

@rafi: Good to know—thanks.

@aidil: Fantastic—works like a charm. Thanks very much!

Jacky888 2 months ago

Download TWRP Recovery for Nexus 6p twrprecoveryapp The 8 best wifi router for apartment the8best How to Install TWRP Recovery on LG G3 twrprecoveryapp.