Skip to content

Commit 2f36af0

Browse files
committed
- enhence -m with customizable extensions
- bump version
1 parent eafbf45 commit 2f36af0

File tree

6 files changed

+40
-21
lines changed

6 files changed

+40
-21
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## v2.4.1
4+
5+
- enhence `-m` with customizable extensions
6+
7+
38
## v2.4.0
49

510
- support `-m` option to mix up pug and asset folder ( copy asset directly from pug )

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ start server ( -r, -p and -c are optional ):
2020
npx server -r <your-web-root> -c <your-server-config> -o <auto-open:true/false> -p <port>
2121

2222

23+
By default assets won't be copied but you can specify extensions to copy with comma-separated strings:
24+
25+
npx server -r <your-web-root> -m png,jpg,jpeg,gif
26+
27+
28+
or use srcbuild's default values by passing `true`:
29+
30+
npx server -r <your-web-root> -m true
31+
32+
2333
you can also add following in your own package.json:
2434

2535
"scripts": {

bin/cli.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if (/\.json$/.exec(process.argv[2] || '')) {
2020
}).option('mix-asset', {
2121
alias: 'm',
2222
description: "mix asset with pug folder",
23-
type: 'bool'
23+
type: 'string'
2424
}).option('config', {
2525
alias: 'c',
2626
description: "config json",
@@ -64,7 +64,8 @@ main = {
6464
},
6565
asset: argv.m ? {
6666
srcdir: 'src/pug',
67-
desdir: 'static'
67+
desdir: 'static',
68+
ext: argv.m && argv.m !== "true" ? argv.m.split(',') : void 8
6869
} : void 8
6970
}, this$.opt.lsp || {}), ref$.base = '.', ref$.i18n = i18n, ref$));
7071
});

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"main": "bin/lib/index.js",
66
"description": "simple, quick template for bootstrap a page",
7-
"version": "2.4.0",
7+
"version": "2.4.1",
88
"files": [
99
"bin/**/*"
1010
],

server.ls

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ else
1717
.option \mix-asset, do
1818
alias: \m
1919
description: "mix asset with pug folder"
20-
type: \bool
20+
type: \string
2121
.option \config, do
2222
alias: \c
2323
description: "config json"
@@ -51,7 +51,10 @@ main = do
5151
.then (i18n) ~>
5252
srcbuild.lsp({
5353
bundle: {configFile: 'bundle.json'}
54-
asset: {srcdir: \src/pug, desdir: \static} if argv.m
54+
asset: {
55+
srcdir: \src/pug, desdir: \static
56+
ext: argv.m.split(',') if argv.m and argv.m != "true"
57+
} if argv.m
5558
} <<< (@opt.lsp or {}) <<< {base: '.', i18n})
5659

5760
if require.main == module =>

0 commit comments

Comments
 (0)