Skip to content

Commit

Permalink
⚡ Improve tag hot-loading process
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Oct 6, 2020
1 parent 5401a47 commit ba0fcef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ desktop\.ini
src/typedefs/ct.js/types.d.ts
app/examples
app/data/bundle.js
app/data/riotTags.js
app/data/bundle.css
app/data/node_requires/**/*
app/data/hotLoadTags
Expand Down
9 changes: 4 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ const riotSettings = {
const compileRiot = () =>
gulp.src('./src/riotTags/**')
.pipe(riot(riotSettings))
.pipe(concat('riot.js'))
.pipe(gulp.dest('./temp/'));
.pipe(concat('riotTags.js'))
.pipe(gulp.dest('./data/'));

const compileRiotPartial = path => {
console.log(`Updating tag at ${path}…`);
Expand All @@ -130,8 +130,7 @@ const concatScripts = () =>
objectMode: true
},
gulp.src('./src/js/3rdparty/riot.min.js'),
gulp.src(['./src/js/**', '!./src/js/3rdparty/riot.min.js']),
gulp.src('./temp/riot.js')
gulp.src(['./src/js/**', '!./src/js/3rdparty/riot.min.js'])
)
.pipe(sourcemaps.init({
largeFile: true
Expand Down Expand Up @@ -180,7 +179,7 @@ const watchScripts = () => {
.on('change', fileChangeNotifier);
};
const watchRiot = () => {
const watcher = gulp.watch('./src/riotTags/**/*');
const watcher = gulp.watch('./src/riotTags/**/*', compileRiot);
watcher.on('error', err => {
notifier.notify(makeErrorObj('Riot failure', err));
console.error('[pug error]', err);
Expand Down
2 changes: 0 additions & 2 deletions src/pug/includes/footer.pug

This file was deleted.

4 changes: 3 additions & 1 deletion src/pug/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ html
if (!window.__dirname) {
window.__dirname = global.__dirname;
}
include includes/footer.pug
div#loading Loading…
script(src="data/bundle.js")
script(src="data/riotTags.js")
script.
// @see https://github.com/microsoft/monaco-editor-samples/blob/master/nwjs-amd-v2/index.html
(function loadMonaco() {
Expand Down

0 comments on commit ba0fcef

Please sign in to comment.