Skip to content

Commit b71fbf2

Browse files
committed
- support customized locals in pug builder
- bump version
1 parent 6fc3455 commit b71fbf2

6 files changed

Lines changed: 14 additions & 6 deletions

File tree

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+
## v0.0.67
4+
5+
- support customized locals in pug builder
6+
7+
38
## v0.0.66
49

510
- fix bug: cached source file is not updated - it's mtime is not retrieved because getting desv mtime failure.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Except common options, each builder may support different options:
9595
- `noView`: default false. when true, js view files ( generated to `viewdir` ) won't be built.
9696
- `viewdir`: default `.view`. a directory for storing prebuilt pug files ( in .js format )
9797
- `bundler`: default null. Auto packing will be possible only if this is provided.
98+
- `locals`: additional local variables for pug context when compiling.
9899
- `lsc`:
99100
- `useGlslify`: default false. set to true if you need glslify of lsc files.
100101
- *NOTE* this is an experiment feature and may be removed ( move to standalone builder ) in the future.

dist/ext/pug.js

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

package-lock.json

Lines changed: 2 additions & 2 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
@@ -1,7 +1,7 @@
11
{
22
"author": "zbryikt",
33
"name": "@plotdb/srcbuild",
4-
"version": "0.0.66",
4+
"version": "0.0.67",
55
"description": "",
66
"main": "./dist/main.js",
77
"files": [

src/ext/pug.ls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pugbuild = (opt={}) ->
77
@i18n = opt.i18n or null
88
@intlbase = opt.intlbase or 'intl'
99
@filters = opt.filters or {}
10+
@locals = opt.locals or {}
1011
@extapi = @get-extapi! # get-dependencies use this, so we should init it before @init
1112
@bundler = opt.bundler
1213
@init({srcdir: 'src/pug', desdir: 'static'} <<< opt)
@@ -26,7 +27,7 @@ pugbuild.prototype = Object.create(base.prototype) <<< do
2627
throw new Error("error when looking up #fn: #{e.toString!}")
2728

2829
get-extapi: ->
29-
ret = do
30+
ret = {} <<< (@locals or {}) <<< do
3031
plugins: [{
3132
resolve: (...args) ~> @pug-resolve.apply @, args
3233
postParse: (dom, opt) ->

0 commit comments

Comments
 (0)