Przeglądaj źródła

add gh-pages publish script

Aneurin Barker Snook 1 rok temu
rodzic
commit
1ff6947784
3 zmienionych plików z 14 dodań i 1 usunięć
  1. 6 1
      eslint.config.js
  2. 1 0
      package.json
  3. 7 0
      scripts/publish-gh-pages.js

+ 6 - 1
eslint.config.js

@@ -1,3 +1,8 @@
 const annybs = require('@annybs/eslint')
 
-module.exports = [...annybs]
+module.exports = [
+  ...annybs,
+  {
+    ignores: ["scripts/**.js"]
+  }
+]

+ 1 - 0
package.json

@@ -6,6 +6,7 @@
     "dev": "vite",
     "build": "tsc && vite build",
     "lint": "npx eslint .",
+    "publish-gh-pages": "node scripts/publish-gh-pages.js",
     "preview": "vite preview"
   },
   "devDependencies": {

+ 7 - 0
scripts/publish-gh-pages.js

@@ -0,0 +1,7 @@
+const ghpages = require('gh-pages')
+
+ghpages.publish('dist', {
+  cname: 'www.aneur.in',
+}, err => {
+  err && console.error(err)
+})