Skip to content

Commit 7a1022f

Browse files
committed
send notification when change occurs [test]
1 parent f22c5c5 commit 7a1022f

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

_layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
font-family: sans-serif;
3030
}
3131
</style>
32-
<h1>layout for everything else</h1>
32+
<h1>Svelte MPA</h1>
3333
</body>
3434
</html>

build.js

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const {join, basename, resolve, dirname, relative} = require( 'path' );
77
const sveltePlugin = require( 'esbuild-svelte' );
88
const {sum} = require( 'lodash' );
99
const parse5 = require( 'parse5' );
10+
const notifier = require('node-notifier');
1011

1112
const [watch, serve, minify, debug, logVars] = ['--watch', '--serve', '--minify', '--debug', '--log-vars'].map( s =>
1213
process.argv.includes( s )
@@ -314,6 +315,11 @@ function layoutFor( path, content = {} ) {
314315
let timeRef = null;
315316

316317
function changeListener( path, stats, type, watcher ) {
318+
notifier.notify({
319+
title: 'Change occurs',
320+
message: `Change occurs in ${path}`
321+
});
322+
317323
if( compiledFiles.has( resolve( path ) ) ) return;
318324
console.log( type + ':', path.replace( __dirname, '' ) );
319325

package-lock.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"esbuild-svelte": "^0.7.3",
1616
"five-server": "^0.1.9",
1717
"lodash": "^4.17.21",
18+
"node-notifier": "^10.0.1",
1819
"parse5": "^7.1.2",
1920
"prettier": "^2.8.8",
2021
"svelte": "^4.0.0",

0 commit comments

Comments
 (0)