aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-10-10 12:45:44 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-10-10 13:04:18 +0800
commit89ca84e47d4958e064b682405e94a3270fc99338 (patch)
treef01c5fb25e5fd4f25db874c371244c0c92d50a5b
parenteaf2639b3c9269b9222bfcd993b7b7a3980f1b2a (diff)
chore: move config files about dev into scripts/
-rw-r--r--assets/favicon.ico (renamed from favicon.ico)bin15406 -> 15406 bytes
-rw-r--r--index.html2
-rw-r--r--package.json5
-rw-r--r--scripts/rollup.config.js (renamed from rollup.config.js)13
-rwxr-xr-xscripts/stylelint.sh2
-rw-r--r--scripts/stylelintrc.json (renamed from .stylelintrc.json)0
6 files changed, 7 insertions, 15 deletions
diff --git a/favicon.ico b/assets/favicon.ico
index 2ddf495..2ddf495 100644
--- a/favicon.ico
+++ b/assets/favicon.ico
Binary files differ
diff --git a/index.html b/index.html
index 3136019..1b9a062 100644
--- a/index.html
+++ b/index.html
@@ -7,7 +7,7 @@
7 7
8 <meta property="og:description" content="Add a default marker to the map."/> 8 <meta property="og:description" content="Add a default marker to the map."/>
9 <meta name="viewport" content="width=device-width, initial-scale=1"/> 9 <meta name="viewport" content="width=device-width, initial-scale=1"/>
10 <link rel="shortcut icon" href="./favicon.ico" type="image/ico"/> 10 <link rel="shortcut icon" href="./assets/favicon.ico" type="image/ico"/>
11 11
12 <!-- FIXME --> 12 <!-- FIXME -->
13 <link rel="stylesheet" type="text/css" href="./dist/css/style.css"/> 13 <link rel="stylesheet" type="text/css" href="./dist/css/style.css"/>
diff --git a/package.json b/package.json
index 37fcb8d..78a217c 100644
--- a/package.json
+++ b/package.json
@@ -18,8 +18,9 @@
18 "leaflet" 18 "leaflet"
19 ], 19 ],
20 "scripts": { 20 "scripts": {
21 "watch": "npx rollup -c -w", 21 "rollup": "npx rollup -c scripts/rollup.config.js",
22 "build": "mkdir -p dist; npm run build-css; npm run build-renderers; npm run build-resources; npx rollup -c", 22 "watch": "npm run rollup -- -w",
23 "build": "mkdir -p dist; npm run build-css; npm run build-renderers; npm run build-resources; npm run rollup",
23 "build-css": "rm -rf dist/css; cp -r src/css dist; cp node_modules/easymde/dist/easymde.min.css dist/css/", 24 "build-css": "rm -rf dist/css; cp -r src/css dist; cp node_modules/easymde/dist/easymde.min.css dist/css/",
24 "build-renderers": "rm -rf dist/renderers; cp -r node_modules/mapclay/dist/renderers dist", 25 "build-renderers": "rm -rf dist/renderers; cp -r node_modules/mapclay/dist/renderers dist",
25 "build-resources": "cp node_modules/easymde/dist/easymde.min.js dist; cp node_modules/easymde/dist/easymde.min.css dist/css", 26 "build-resources": "cp node_modules/easymde/dist/easymde.min.js dist; cp node_modules/easymde/dist/easymde.min.css dist/css",
diff --git a/rollup.config.js b/scripts/rollup.config.js
index f5a22eb..d4af05f 100644
--- a/rollup.config.js
+++ b/scripts/rollup.config.js
@@ -18,14 +18,14 @@ const general = {
18 ], 18 ],
19 watch: { 19 watch: {
20 clearScreen: false, 20 clearScreen: false,
21 include: ['src/**', 'mapclay/dist/mapclay.mjs'], 21 include: ['src/**', 'node_modules/mapclay/dist/mapclay.mjs'],
22 }, 22 },
23 context: 'window', 23 context: 'window',
24 plugins: [ 24 plugins: [
25 { 25 {
26 name: 'watch-mapclay', 26 name: 'watch-mapclay',
27 buildStart () { 27 buildStart () {
28 const mapclayPath = join(process.cwd(), 'mapclay', 'dist', 'mapclay.mjs') 28 const mapclayPath = join(process.cwd(), 'node_modules', 'mapclay', 'dist', 'mapclay.mjs')
29 if (existsSync(mapclayPath)) { 29 if (existsSync(mapclayPath)) {
30 this.addWatchFile(mapclayPath) 30 this.addWatchFile(mapclayPath)
31 } else { 31 } else {
@@ -42,15 +42,6 @@ const general = {
42 return null 42 return null
43 }, 43 },
44 }, 44 },
45 {
46 name: 'mapclay',
47 resolveId (source) {
48 if (source === 'mapclay' && existsSync(join('.', 'mapclay'))) {
49 return './mapclay/dist/mapclay.mjs'
50 }
51 return null
52 },
53 },
54 node(), 45 node(),
55 commonjs(), 46 commonjs(),
56 production && terser({ 47 production && terser({
diff --git a/scripts/stylelint.sh b/scripts/stylelint.sh
index 91561de..c44d00b 100755
--- a/scripts/stylelint.sh
+++ b/scripts/stylelint.sh
@@ -1,4 +1,4 @@
1#! /bin/bash 1#! /bin/bash
2 2
3shopt -s extglob 3shopt -s extglob
4stylelint src/css/!(easymde.min.css) --fix 4stylelint -c scripts/stylelintrc.json src/css/!(easymde.min.css) --fix
diff --git a/.stylelintrc.json b/scripts/stylelintrc.json
index 6e8978b..6e8978b 100644
--- a/.stylelintrc.json
+++ b/scripts/stylelintrc.json