Skip to content

Commit

Permalink
增强离线构建
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacharia2 committed Jul 5, 2023
1 parent 67bf189 commit a244060
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"server": "npx cross-env TIDDLYWIKI_PLUGIN_PATH='./plugins' TIDDLYWIKI_THEME_PATH='./themes' TIDDLYWIKI_LANGUAGE_PATH='./languages' npx tiddlywiki . --listen port=8080",
"buildonline": "node -e \"require('./scripts/build').buildOnlineHTML('public-dist', 'index.html');\"",
"buildoffline": "node -e \"require('./scripts/build').buildOfflineHTML('public-dist', 'offline.html');\"",
"buildlibrary": "node -e \"require('./scripts/build').buildLibrary('[prefix[$:/]!prefix[$:/plugins/tiddlywiki/]!prefix[$:/themes/tiddlywiki/]!prefix[$:/languages/]!tag[$:/tags/PluginLibrary]!prefix[$:/plugins/kookma]]', 'public-dist/library');\""
"buildlibrary": "node -e \"require('./scripts/build').buildLibrary('[prefix[$:/]!prefix[$:/plugins/tiddlywiki/]!prefix[$:/themes/tiddlywiki/]!prefix[$:/languages/]!tag[$:/tags/PluginLibrary]!prefix[$:/plugins/kookma]]', 'public-dist/library');\"",
"clean": "rimraf public-dist"
},
"devDependencies": {
"cross-env": "7.0.3",
Expand All @@ -13,6 +14,7 @@
"tiddlywiki": "^5.2.7",
"uglify-js": "3.17.4",
"workbox-cli": "7.0.0",
"zx": "^7.0.0"
"zx": "^7.0.0",
"rimraf": "^5.0.1"
}
}
2 changes: 1 addition & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function buildOfflineHTML(distDir, htmlName, minify, excludeFilter) {
if (typeof excludeFilter !== 'string') excludeFilter = '-[is[draft]]';

// 构建HTML
shell(`npx tiddlywiki . --output ${distDir}` +
shell(`npx tiddlywiki +plugins/tiddlywiki/filesystem +plugins/tiddlywiki/tiddlyweb . --output ${distDir}` +
' --deletetiddlers \'[[$:/UpgradeLibrary]] [[$:/UpgradeLibrary/List]]\'' +
` --rendertiddler $:/plugins/tiddlywiki/tiddlyweb/save/offline index-raw.html text/plain "" publishFilter "${excludeFilter}"`
);
Expand Down

0 comments on commit a244060

Please sign in to comment.