25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 년 전
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #Browsersync - HTML/CSS injection example
  2. ## Installation/Usage:
  3. To try this example, follow these 4 simple steps.
  4. **Step 1**: Clone this entire repo
  5. ```bash
  6. $ git clone https://github.com/Browsersync/recipes.git bs-recipes
  7. ```
  8. **Step 2**: Move into the directory containing this example
  9. ```bash
  10. $ cd bs-recipes/recipes/html.injection
  11. ```
  12. **Step 3**: Install dependencies
  13. ```bash
  14. $ npm install
  15. ```
  16. **Step 4**: Run the example
  17. ```bash
  18. $ npm start
  19. ```
  20. ### Additional Info:
  21. To see the live HTML injecting, along with CSS injection, simply perform changes to either `index.html` or `css/main.css`
  22. ### Preview of `app.js`:
  23. ```js
  24. /**
  25. * Require Browsersync
  26. */
  27. var bs = require('browser-sync').create();
  28. /**
  29. * Run Browsersync with server config
  30. */
  31. bs.init({
  32. server: "app",
  33. files: ["app/css/*.css"],
  34. plugins: [
  35. {
  36. module: "bs-html-injector",
  37. options: {
  38. files: ["app/*.html"]
  39. }
  40. }
  41. ]
  42. });
  43. ```