diff --git a/app/api/page.js b/app/api/page.js index 73637b6..41923c7 100644 --- a/app/api/page.js +++ b/app/api/page.js @@ -1,6 +1,6 @@ const common = require('./common') -const Tree = window.__nfptree?.tree || [] +const Tree = window.__nfptree && window.__nfptree.tree || [] exports.Tree = Tree diff --git a/app/api/page.p.js b/app/api/page.p.js index 13c822d..386a734 100644 --- a/app/api/page.p.js +++ b/app/api/page.p.js @@ -1,6 +1,6 @@ const common = require('./common') -const Tree = window.__nfptree || [] +const Tree = window.__nfptree && window.__nfptree.tree || [] exports.Tree = Tree diff --git a/app/menu/menu.js b/app/menu/menu.js index 291d758..123b921 100644 --- a/app/menu/menu.js +++ b/app/menu/menu.js @@ -37,6 +37,7 @@ const Menu = { }, view: function() { + console.log(Page.Tree) return [ m('div.top', [ m(m.route.Link, diff --git a/package.json b/package.json index 565415f..afe13e9 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "test": "echo \"Error: no test specified\" && exit 1", "build:prod": "sass -s compressed app/app.scss public/assets/app.css && sass -s compressed app/admin.scss public/assets/admin.css && asbundle app/index.js public/assets/app.js && asbundle app/admin.js public/assets/admin.js", "build": "sass app/app.scss public/assets/app.css && sass app/admin.scss public/assets/admin.css && asbundle app/index.js public/assets/app.js && asbundle app/admin.js public/assets/admin.js", - "build:watch": "npm-watch build", - "dev:server": "npm run build && node dev.mjs | bunyan", + "dev:build": "npm-watch build", + "dev:server": "node dev.mjs | bunyan", "dev": "npm-watch dev:server", "watch:sass:public": "sass --watch app/app.scss public/assets/app.css", "watch:sass:admin": "sass --watch app/admin.scss public/assets/admin.css", @@ -21,7 +21,14 @@ "watch": { "dev:server": { "patterns": [ - "api/*", + "api/*" + ], + "extensions": "js,mjs", + "quiet": true, + "inherit": true + }, + "build": { + "patterns": [ "app/*" ], "extensions": "js,mjs",