Skip to content

Commit c2a6b0a

Browse files
committed
Chore: tweak manifest
1 parent c311825 commit c2a6b0a

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636
"webpack-dev-server": "^2.9.5"
3737
},
3838
"scripts": {
39-
"build": "cross-env NODE_ENV=production run-s clean build:*",
39+
"build": "cross-env NODE_ENV=production run-s clean build:* -s",
4040
"build:html": "appcache-manifest-fixer src/index.html -o dist/index.html",
4141
"build:js": "webpack --progress --hide-modules",
4242
"build:monaco": "cpx node_modules/monaco-editor/min/vs/**/* dist/vs",
43-
"build:manifest": "appcache-manifest \"dist/**/*.{css,html,js,svg}\" --prefix /vue-eslint-demo --network-star -o dist/index.appcache",
43+
"build:manifest": "appcache-manifest \"dist/**/*.{css,html,js,svg}\" --prefix /vue-eslint-demo --network-star -o dist/index.appcache && node scripts/tweak-manifest",
4444
"build:versions": "node scripts/make-versions",
4545
"clean": "rimraf dist",
4646
"deploy": "node scripts/deploy",
4747
"preversion": "npm run build",
4848
"postversion": "git push && git push --tags && npm run deploy",
49-
"watch": "cross-env NODE_ENV=development run-p watch:*",
49+
"watch": "cross-env NODE_ENV=development run-p watch:* -s",
5050
"watch:html": "cpx src/*.html dist --watch",
5151
"watch:js": "webpack-dev-server --open --hot",
5252
"watch:monaco": "cpx node_modules/monaco-editor/min/vs/**/* dist/vs --watch"

scripts/deploy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ main()
99
* @returns {void}
1010
*/
1111
function main() {
12-
exec("npm run build")
12+
exec("npm run -s build")
1313
exec("git checkout gh-pages")
1414

1515
if (String(sh.cat("dist/versions.json")) === String(sh.cat("versions.json"))) {
@@ -19,7 +19,7 @@ function main() {
1919
}
2020

2121
rm("-rf", "vs", "index.*")
22-
cp("dist/*", ".")
22+
cp("-r", "dist/*", ".")
2323
exec("git add -A")
2424
exec("git commit -m \"Update: website\"")
2525
exec("git push")

scripts/tweak-manifest.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*eslint-env node */
2+
3+
const fs = require("fs")
4+
const WHITELIST = new Set([
5+
"/vue-eslint-demo/index.html",
6+
"/vue-eslint-demo/index.js",
7+
"/vue-eslint-demo/vs/base/worker/workerMain.js",
8+
"/vue-eslint-demo/vs/basic-languages/src/html.js",
9+
"/vue-eslint-demo/vs/editor/editor.main.css",
10+
"/vue-eslint-demo/vs/editor/editor.main.js",
11+
"/vue-eslint-demo/vs/editor/editor.main.nls.js",
12+
"/vue-eslint-demo/vs/editor/contrib/suggest/browser/media/String_16x.svg",
13+
"/vue-eslint-demo/vs/editor/contrib/suggest/browser/media/String_inverse_16x.svg",
14+
"/vue-eslint-demo/vs/editor/standalone/browser/quickOpen/symbol-sprite.svg",
15+
"/vue-eslint-demo/vs/language/css/cssMode.js",
16+
"/vue-eslint-demo/vs/language/css/cssWorker.js",
17+
"/vue-eslint-demo/vs/language/html/htmlMode.js",
18+
"/vue-eslint-demo/vs/language/html/htmlWorker.js",
19+
"/vue-eslint-demo/vs/language/typescript/lib/typescriptServices.js",
20+
"/vue-eslint-demo/vs/language/typescript/src/mode.js",
21+
"/vue-eslint-demo/vs/language/typescript/src/worker.js",
22+
"/vue-eslint-demo/vs/loader.js",
23+
])
24+
25+
const original = fs.readFileSync("dist/index.appcache", "utf8")
26+
const modified = original.split("\n")
27+
.filter(line => !line.startsWith("/") || WHITELIST.has(line))
28+
.join("\n")
29+
30+
fs.writeFileSync("dist/index.appcache", modified)

0 commit comments

Comments
 (0)