Created
August 6, 2017 00:08
-
-
Save kcmr/dd96a719d549f6976f952ab3e1e0be91 to your computer and use it in GitHub Desktop.
Browser Sync for a Polymer Web Component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const bs = require('browser-sync').create(); | |
const componentPath = `/components/${__dirname.split('/').pop()}`; | |
bs.init({ | |
files: [ '**/*.{html,js,css}' ], | |
open: false, | |
ghostMode: false, | |
startPath: `${componentPath}/demo/index.html`, | |
serveStatic: [{ | |
route: componentPath, | |
dir: '.' | |
}, { | |
route: '/components', | |
dir: 'bower_components' | |
}], | |
server: { | |
baseDir: '.', | |
routes: { | |
componentPath: '.', | |
'/components': 'bower_components' | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "new-component", | |
"license": "MIT", | |
"scripts": { | |
"serve": "node browsersync.conf" | |
}, | |
"devDependencies": { | |
"browser-sync": "^2.18.13" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment