browser-sync | Keep multiple browsers & devices in sync when building | Frontend Framework library
kandi X-RAY | browser-sync Summary
kandi X-RAY | browser-sync Summary
Keep multiple browsers & devices in sync when building websites. Follow @Browsersync on twitter for news & updates.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of browser-sync
browser-sync Key Features
browser-sync Examples and Code Snippets
npm install --dev create-cert-files browser-sync
const fakeCert = require('create-cert-files')()
const browserSync = require('browser-sync')
browserSync.init({
https: {
key: fakeCert.key,
cert: fakeCert.cert
}
})
npm run dev
-----------
(optional) configure browser-sync using environment variables before running.
PORT= # browser-sync app's proxy port; default is 5000
PORT_DEV= # browser-sync listeing port; default is 3000
npm install -g http-server
http-server -c-1
npm install -g browser-sync
browser-sync start --server -f -w
# Override the web container's standard HTTP_EXPOSE and HTTPS_EXPOSE
# This is to expose the browsersync port.
version: '3.6'
services:
web:
# ports are a list of exposed *container* ports
expose:
- '3000'
environment:
browser-sync start --proxy "http://localhost:8080/test" --files "src/java/com/test/, glassfish/domains/domain1/config/" --watchEvents add change " src/java/com/test/, glassfish/domains/domain1/config/" --no-notify --host 192.168.X.X --port
Step1: npm install -g browser-sync
Step2: In webpack.mix.js file add this: mix.browserSync('localhost:8000');
Step3: php artisan serve
Step4: npm run watch
npm install --save-dev browser-sync browser-sync-webpack-plugin
const BrowserSyncPlugin = require("browser-sync-webpack-plugin")
module.exports = {
devServer: {
port: 3100
},
plugins: [
new BrowserSy
"scripts": {
"bsync": "./bin/echo.sh"
}
#!/bin/bash
echo 'Starting BrowserSync' browser-sync start
"scripts": {
"bsync": "echo \"Starting BrowserSync\" && exit 1"
}
Community Discussions
Trending Discussions on browser-sync
QUESTION
I've scoured the internet and have bits and pieces but nothing is coming together for me. I have a local Drupal environment running with Lando. I've successfully installed and configured webpack. Everything is working except when I try to watch or hot reload.
When I run lando npm run build-dev
(that currently uses webpack --watch
I can see my changes compiled successfully into the correct folder. However, when I refresh my Drupal site, I do not see that changes. The only time I see my updated JS changes are when I run lando drush cr
to clear cache. Same things are happening when I try to configure the webpack-dev-server.
I can get everything to watch for changes and compile correctly but I cannot get my browser to reload my files, they stay cached. I'm at a loss.
I've tried configuring a proxy in my .lando.yml , and have tried different things with the config options for devServer. I'm just not getting a concise answer, and I just don't have the knowledge to understand exactly what is happening. I believe it has to do with Docker containers not being exposed to webpack (??) but I don't understand how to configure this properly.
These are the scripts I have set up in my package.json
, build
outputs my production ready files into i_screamz/js/dist
, build-dev
starts a watch and compiles non-minified versions to i_screamz/js/dist-dev
- start
I have in here from trying to get the devServer to work. I'd like to get webpack-dev-server
running as I'd love to have reloading working.
ANSWER
Answered 2022-Apr-02 at 15:48I've updated my code files above to reflect reflect a final working setup with webpack. The main answer was a setting in
/web/sites/default/settings.local.php
**Disable CSS & JS aggregation. **
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
I found a working setup from saschaeggi and just tinkered around until I found this setting. So thank you! I also found more about what this means here. This issue took me way longer than I want to admit and it was so simple. I don't know why the 'Disabling Caching css/js aggregation' page never came up when I was furiously googling a caching issue. Hopefully this answer helps anyone else in this very edge case predicament.
I have webpack setup within my theme root folder with my Drupal theme files. I run everything with Lando, including NPM. I found a nifty trick to switch the dist-dev and dist libraries for development / production builds from thinkshout.
I should note my setup does not include hot-reloading but I can at least compile my files and refresh immediately and see my changes. The issue I was having before is that I would have to stop my watches to drush cr
and that workflow was ridiculous. I've never gotten hot reloading to work with with either BrowserSync or Webpack Dev Server and I might try to again but I need to move on with my life at this point.
I've also note included sass yet, so these files paths will change to include compilation and output for both .scss and .js files but this is the basic bare min setup working.
QUESTION
I am getting the following when I try to run ng serve --open
ANSWER
Answered 2021-Nov-11 at 23:48Most probably an issue with SSL. For me it was the pass phrase in the SSL key.
QUESTION
In my latest project, I'm using laravel-mix with the built in browserSync, and I've added tailwindCss as a package.
This is the webpack.mix.js
file:
ANSWER
Answered 2022-Feb-15 at 22:01Ah, I think I discovered what's going on here. Looks like it's a known issue with Webpack documented by Tailwind themselves:
If your CSS seems to be rebuilding in an infinite loop, there’s a good chance it’s because your build tool doesn’t support the glob option when registering PostCSS dependencies.
Many build tools (such as webpack) don’t support this option, and as a result we can only tell them to watch specific files or entire directories. We can’t tell webpack to only watch *.html files in a directory for example.
That means that if building your CSS causes any files in those directories to change, a rebuild will be triggered, even if the changed file doesn’t match the extension in your glob.
And here's their recommendation:
To solve this problem, use more specific paths in your content config, making sure to only include directories that won’t change when your CSS builds:
QUESTION
I tried to run the gulp to covert SCSS to CSS,the gulp is working wihout any error but there aren't have any css files output to the target folder, I also tried to change the output path but it still didn't work,and my code is below :
...ANSWER
Answered 2022-Feb-11 at 17:24In your watchTask
you have this:
src/**/*.+(scss|sass)
note the +
sign before the alternation.
But in your styleLink
variable you have:
QUESTION
I’m trying to integrate three.js with wordpress via webpack. The problem is that, 3d cube is not appearing inside canvas.
...ANSWER
Answered 2022-Feb-06 at 19:29According to your comment, you are including the script in the head tag, just move it to the end of the body (footer).
You are not able to see anything because your script tries to get the canvas element, which does yet exist at that time. By moving your script to the end, you are ensuring that your page has rendered before your script is ran.
Using WordPress you can do:
QUESTION
I have created a new Laravel jetstream project with inertia.
I use Vagrant Homestead.
When I open a new page I get this error: GET http://localhost:3000/browser-sync/browser-sync-client.js net::ERR_CONNECTION_REFUSED
.
Also Vue devtools won't load, I get this error: DevTools failed to load source map: Could not load content for http://schoolsysteem.test/js/index.js.map: HTTP error: status code 404, net: :ERR_HTTP_RESPONSE_CODE_FAILURE
.
What's the problem?
...ANSWER
Answered 2022-Feb-03 at 10:49You can fix the problem by just disable the browser-sync feature. Remove these 2 lines from app.blade.php:
QUESTION
Here i am trying to migrate my existing site which is using gulp 3. Now upgrading gulp from 3 to 4.
Below is Gulpfile.js
...ANSWER
Answered 2022-Jan-28 at 21:00Try defining your "sprite"
task before it gets called in the "local-development"
task (and any others that may fall into the same pattern).
When creating tasks via the gulp.task(...)
form you do need to have those tasks created (so they can be registered) prior to their being called. Otherwise you will forward-referencing them.
Forward referencesA forward reference is when you compose tasks, using string references, that haven't been registered yet. This was a common practice in older versions, but this feature was removed to achieve faster task runtime and promote the use of named functions.
In newer versions, you'll get an error, with the message "Task never defined", if you try to use forward references.
One advantage of the function myGulpTask() {...}
form of creating tasks is that do not need to be declared prior to calling them.
QUESTION
I'm trying to use the following code:
@apply w-[calc(theme(width.1/3)_-_1rem)]
which according to the docs, should work. But every time I try and compile the code I get the following error:
ANSWER
Answered 2022-Jan-17 at 19:05It seems Tailwind cannot take a value from config file on the fly (within square brackets in a JIT mode). I see the option to register custom width class within configuration file like
QUESTION
Getting below error after installed latest node.js (v16.13.1)
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (93) For more information on which environments are supported please see: https://github.com/sass/node-sass/releases/tag/v4.14.1 I have created static pages for my application and use sass and gulp
I have a static pages and using Sass in the page and use gulp to run on the browser.(npm install). Below are the version which worked my application:
- Node.js - 12.18.0
- gulp - "4.0.2"
- "gulp-sass": "4.1.0"
Package.json file
...ANSWER
Answered 2022-Jan-12 at 23:22gulp-sass 4.1.0 uses node-sass 4, and node-sass 4 does not support Node.js 16, as indicated in this table.
To support Node.js 16, upgrade gulp-sass: the latest version today is 5.1.0:
QUESTION
In Laravel 8 app where adminarea is implemented with jquery/bootstrap I need to make frontend with inertiajs/vuejs3. So I installed inertiajs with vuejs3 and I added frontend template resources/views/app.blade.php :
...ANSWER
Answered 2021-Dec-21 at 11:46You need to add alias to your layouts folder:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install browser-sync
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page