瀏覽代碼

Use the build folder

customisations
alemart 2 月之前
父節點
當前提交
09fb5ac5e7
共有 3 個文件被更改,包括 5 次插入5 次删除
  1. 1
    1
      docs/hooks.py
  2. 1
    1
      esbuild.mjs
  3. 3
    3
      package.json

+ 1
- 1
docs/hooks.py 查看文件

@@ -11,7 +11,7 @@ def copy_static_files(config, **kwargs):
11 11
 def copy_directory(dir_path, site_dir):
12 12
     d = os.path.join(site_dir, dir_path)
13 13
     os.makedirs(d, exist_ok=True)
14
-    s = dir_path if dir_path != "dist" else "www/dist"
14
+    s = dir_path if dir_path != "dist" else "build/dist"
15 15
     copy_tree(s, d)
16 16
 
17 17
 def copy_tree(src, dst, symlinks=False, ignore=None):

+ 1
- 1
esbuild.mjs 查看文件

@@ -29,7 +29,7 @@ const options = {
29 29
     legalComments: 'inline',
30 30
     banner: { js: generateBanner() },
31 31
     footer: { js: serve ? generateLiveReloadCode() : '' },
32
-    outfile: 'www/dist/' + (minify ? 'encantar.min.js' : 'encantar.js'),
32
+    outfile: 'build/dist/' + (minify ? 'encantar.min.js' : 'encantar.js'),
33 33
     sourcemap: !production && 'linked',
34 34
     logLevel: 'info',
35 35
 };

+ 3
- 3
package.json 查看文件

@@ -31,14 +31,14 @@
31 31
   "types": "build/types/main.d.ts",
32 32
   "scripts": {
33 33
     "start": "node esbuild.mjs --minify --serve",
34
-    "prebuild": "tsc --noEmit && npm run clean",
34
+    "prebuild": "tsc --noEmit && npm run clean && bash -c 'mkdir -p build/{dist,types,plugins}'",
35 35
     "build": "node esbuild.mjs && node esbuild.mjs --minify",
36 36
     "build-types": "tsc --emitDeclarationOnly --declaration --declarationDir build/types",
37
-    "plugins": "for f in $(find plugins/ -name *.js); do esbuild --minify < $f > ${f%.*}.min.js; done",
37
+    "plugins": "for f in $(find plugins/ -name *.js); do esbuild --minify < $f > build/${f%.*}.min.js; done",
38 38
     "update": "npm update speedy-vision",
39 39
     "deploy": "mkdocs gh-deploy",
40 40
     "docs": "mkdocs serve",
41
-    "clean": "rm -rf www/dist/*.* && rm -rf build/",
41
+    "clean": "rm -rf build/",
42 42
     "test": "echo \"Error: no test specified\" && exit 1"
43 43
   },
44 44
   "dependencies": {

Loading…
取消
儲存