That’s not that bad. I could deal with that. However…
Netlify Dev claims that it can do hot reloading, but it requires you to stream it to a live URL. I don’t need to do that with browsersync. I’m also not sure that they both reload in the same manner.
Additionally, I don’t think Netlify Dev can sync between multiple browsers/devices at the same time like browsersync does. This capability is extremely useful and I’d hate to see it go.
Do I need to ditch browsersync and just use gulp to watch for file changes, in two separate tabs? It’s bearable, but seems silly.
I’m open to all ideas, but I’m trying to avoid using any static site generators (for now). Thanks for reading.
netlfy dev doesnt require static site generators, and you dont need to ditch browsersync. you can tell netlify dev to run that command for you. inside netlify.toml, add
[dev]
command="gulp dev"
port=1234 # whatever port gulp/browsersync listens on
I dont have a ton of personal experience with browsersync so idk how the multiple browser thing would work with netlify dev, but theres a good chance it’ll work with this config.
this config is documented in the netlify dev docs but dont have a place in the netlify.toml official docs yet
I didn’t think I’d have to use a SSG or ditch browsersync, but thanks for confirming.
I also saw this in the Netlify dev docs but I forgot to mention it. Whoops.
When I do as you have suggested, it works… for a second or two. Then I get this in the console:
[19:28:01] Finished 'dev' after 12 ms
[Browsersync] Access URLs:
--------------------------------------
Local: http://localhost:3000
.
Connected!
Waiting for localhost:34567.
Connected!
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
at module.exports (~/.npm-global/lib/node_modules/netlify-cli/node_modules/@netlify/rules-proxy/index.js:94:29)
at startProxy (~/.npm-global/lib/node_modules/netlify-cli/src/commands/dev/index.js:108:20)
And here’s my .toml:
[build]
command = "npm run init; gulp all"
functions = "lambda"
publish = "build"
[context.production]
command = "npm run init; gulp all -p"
[dev]
command = "gulp dev"
port = 3000