私は発電機を使用してhttps://github.com/seaneking/generator-polymer-elementから終了しました。
これは私の作業gulpfile.jsです:
https://jsfiddle.net/svantetobias/qqwcrwcf/1/は、私がここで重要な部分があると思う:
// Core deps
// Using require() because of rollup babel preset
const gulp = require('gulp');
const gulprun = require('run-sequence');
const browserSync = require('browser-sync');
const bs = browserSync.create()
const OPTIONS = {
browserSync: {
server: {
baseDir: './',
index: 'demo/index.html',
routes: {
'/': './bower_components'
}
},
open: false, // Don't open browser on reload
notify: true // Show notifications in the browser.
}
};
gulp.task('build',() => {
// Build stuff...
});
gulp.task('serve', (callback) => bs.init(OPTIONS.browserSync));
gulp.task('refresh',() => bs.reload());
gulp.task('watch',() => gulp.watch(['src/**/*'],() => gulprun('build', 'refresh')));
gulp.task('default', ['build', 'serve', 'watch']);
この作業を取得上の任意の運?私は以下の答えを使用したくない。というのも、それはたくさんのエキストラを含んでいるからだ。彼がリンクしているリポジトリは失敗しているようだ。私の目標は、シンプルなままにして、ブラウザ同期をカスタムビルドに追加することです。 – Oneezy
gulpファイルに次の変更が加えられました。https://gist.github.com/edvail/4c0ffb1d76c86808cd3d7b467b0e7ab5 –
ありがとう!私はそれにショットを与える – Oneezy