This commit is contained in:
tatianamac
2019-11-26 14:50:43 -08:00
parent 8a55660ed0
commit 6d5445ecc5
13894 changed files with 2233957 additions and 0 deletions

20
node_modules/bs-recipes/recipes/html.injection/app.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
/**
* Require Browsersync
*/
var bs = require('browser-sync').create();
/**
* Run Browsersync with server config
*/
bs.init({
server: "app",
files: ["app/css/*.css"],
plugins: [
{
module: "bs-html-injector",
options: {
files: ["app/*.html"]
}
}
]
});

View File

@ -0,0 +1,8 @@
body {
background: white;
color: black;
}
p.lede {
font-size: 2em;
}

View File

@ -0,0 +1,16 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Browsersync Server Example</title>
<link rel='stylesheet' href='css/main.css'>
</head>
<body>
<header>
<h1>Browsersync HTML injection Examples</h1>
<p>Any changes you make to the HTML will be injected</p>
</header>
</body>
</html>

View File

@ -0,0 +1,2 @@
To see the live HTML injecting, along with CSS injection, simply perform changes to either `index.html` or `css/main.css`

View File

@ -0,0 +1,14 @@
{
"name": "bs-recipes-html-injection",
"version": "1.0.0",
"description": "HTML/CSS injection example",
"main": "app.js",
"scripts": {
"start": "node app.js"
},
"license": "MIT",
"devDependencies": {
"bs-html-injector": "^2.0.3",
"browser-sync": "^2.1.6"
}
}

View File

@ -0,0 +1,56 @@
#Browsersync - HTML/CSS injection example
## Installation/Usage:
To try this example, follow these 4 simple steps.
**Step 1**: Clone this entire repo
```bash
$ git clone https://github.com/Browsersync/recipes.git bs-recipes
```
**Step 2**: Move into the directory containing this example
```bash
$ cd bs-recipes/recipes/html.injection
```
**Step 3**: Install dependencies
```bash
$ npm install
```
**Step 4**: Run the example
```bash
$ npm start
```
### Additional Info:
To see the live HTML injecting, along with CSS injection, simply perform changes to either `index.html` or `css/main.css`
### Preview of `app.js`:
```js
/**
* Require Browsersync
*/
var bs = require('browser-sync').create();
/**
* Run Browsersync with server config
*/
bs.init({
server: "app",
files: ["app/css/*.css"],
plugins: [
{
module: "bs-html-injector",
options: {
files: ["app/*.html"]
}
}
]
});
```