Improve webpack integration
- added gulp build --watch - updated documentation - bundle is now loaded after DOMContentLoaded event Related to blueprint webpack Change-Id: I04c341987002687efd6713c5296b23e491aacd6f
This commit is contained in:
parent
585e200d20
commit
36dac36184
|
@ -279,6 +279,17 @@ Running Nailgun in Fake Mode
|
|||
|
||||
gulp dev-server --dev-server-host=127.0.0.1 --dev-server-port=8080 --nailgun-host=127.0.0.1 --nailgun-port=8000
|
||||
|
||||
If you don't want to use a development server but would like to recompile
|
||||
the bundle on any change, use::
|
||||
|
||||
gulp build --watch
|
||||
|
||||
If automatic rebuild on change doesn't work, most likely you need to
|
||||
increase the limit of inotify watches::
|
||||
|
||||
echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches
|
||||
|
||||
|
||||
Note: Diagnostic Snapshot is not available in a Fake mode.
|
||||
|
||||
Running the Fuel System Tests
|
||||
|
|
|
@ -249,10 +249,16 @@ gulp.task('build', function(cb) {
|
|||
new webpack.optimize.UglifyJsPlugin({compress: {warnings: false}})
|
||||
);
|
||||
}
|
||||
if (argv.watch) {
|
||||
config.watch = true;
|
||||
}
|
||||
|
||||
rimraf.sync(config.output.path);
|
||||
|
||||
webpack(config).run(function(err, stats) {
|
||||
var compiler = webpack(config);
|
||||
var run = config.watch ? compiler.watch.bind(compiler, config.watchOptions) : compiler.run.bind(compiler);
|
||||
|
||||
run(function(err, stats) {
|
||||
if (err) return cb(err);
|
||||
|
||||
gutil.log(stats.toString(WEBPACK_STATS_OPTIONS));
|
||||
|
@ -274,7 +280,7 @@ gulp.task('build', function(cb) {
|
|||
.pipe(indexFilter.restore())
|
||||
.pipe(gulp.dest(targetDir))
|
||||
.on('end', cb);
|
||||
} else {
|
||||
} else if (!config.watch) {
|
||||
cb();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -60,12 +60,14 @@
|
|||
}());
|
||||
|
||||
if (hasCookies && hasStorage) {
|
||||
loadScript(
|
||||
'static/build/bundle.js?__CACHE_BUST__',
|
||||
'Failed to load compressed Fuel UI bundle. ' +
|
||||
'If you are using development environment, ' +
|
||||
'please run "gulp build" to compile Fuel UI.'
|
||||
);
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
loadScript(
|
||||
'static/build/bundle.js?__CACHE_BUST__',
|
||||
'Failed to load compressed Fuel UI bundle. ' +
|
||||
'If you are using development environment, ' +
|
||||
'please run "gulp build" to compile Fuel UI.'
|
||||
);
|
||||
});
|
||||
} else {
|
||||
showError('Fuel UI requires Cookies and LocalStorage to work');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue