Comments (7)
Hey @janusch thanks for the issue.
Your first line should work fine. When you say "browser-sync does not pickup the changes" could you elaborate more?
from parallelshell.
@keithamus thanks for your quick reply!
browser-sync is like live reload, so it should recognized files changed by webpack and reload the browser. Somehow webpack repackages and browser-sync does nothing. This only occurs when the clean task is part of the script, otherwise it works fine.
For now I am using "start": "parallelshell 'npm run dev_watch' 'npm run dev'"
this script and do not clean the folder on start anymore. I would prefer to clean before though.
I am not sure how to elaborate more, there is no error or log, sorry.
from parallelshell.
Why not run npm run clean
before running npm run dev
? e.g.
"start": "parallelshell 'npm run dev_watch' 'npm run clean && npm run dev'"
from parallelshell.
Thank you for looking into it!
I tried your proposed solution, but for whatever reason browser-sync does not trigger.
I think ill just keep the clean task out of the start script and go with "start": "parallelshell 'npm run dev_watch' 'npm run dev'"
I'll just run the clean script when i need it.
Btw, there is one thing that I am missing without gulp, maybe you have an idea on how to do that with a script. It is the gulp-inject task, where you can inject file references into an html file. This is useful for browser cache busting, I add a hash when the file changes.
Thanks again for your help!
from parallelshell.
I typically use a templating language, such as Handlebars and pass the template some JSON (either through the cli if it allows it, otherwise I'll write a bit of JS). This is generally much more flexible than something like gulp-inject, and scales well for when your project gets bigger.
See https://github.com/keithamus/npm-scripts-example/blob/master/package.json#L36 for an example of this.
If you really want to stick with gulp-inject style regexp replacement, then try keithamus/npm-scripts-example#22
from parallelshell.
could be a problem of browser-sync.
Maybe it watches for file changes, but when the file gets deleted the watcher vanishes also. The only workaround is to watch the whole folder and filter the change events..
I had a similar problem when a file watcher didn't fire on changes of a compiled js file for the same reason. When compiling from coffeescript, the js gets deleted and the watcher too
from parallelshell.
Interesting, @paulpflug thanks for your reply!
I think with this we can safely close this issue.
from parallelshell.
Related Issues (20)
- Why BrowserSync over Webpack-dev-server? HOT 1
- Issue with assigning variables HOT 5
- Feature request: Prefix output with (colored?) indicator of which process it came from HOT 1
- Suggestions for why parallelshell breaks node-notifier?
- Some output goes to the wrong terminal tab with two tabs open HOT 4
- Same argument passed to all shells? HOT 1
- Exit code is 0 when first command succeeds and second fails HOT 4
- fails on node8 HOT 3
- child_process throwing error ('"cwd" must be a string') HOT 24
- /usr/bin/env: βnode\rβ: No such file or directory ... HOT 9
- Allow 3.0 to be backwards compatible with < Node 8 HOT 6
- TypeError: "cwd" must be a string HOT 3
- New release? HOT 5
- Node 10.x version check fails HOT 9
- child_process throwing error ('"cwd" must be a string') HOT 2
- ERR_INVALID_ARG_TYPE error for Node v10.5.0 HOT 7
- The "options.cwd" property must be of type string. Received type function HOT 36
- Please do a release with the version check fork! HOT 7
- The "options.cwd" property must be of type string. Received type function HOT 1
- npm ERR! code ELIFECYCLE HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parallelshell.