@plotdb/srcbuild 0.0.66 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -95,6 +95,7 @@ Except common options, each builder may support different options:
95
95
  - `noView`: default false. when true, js view files ( generated to `viewdir` ) won't be built.
96
96
  - `viewdir`: default `.view`. a directory for storing prebuilt pug files ( in .js format )
97
97
  - `bundler`: default null. Auto packing will be possible only if this is provided.
98
+ - `locals`: additional local variables for pug context when compiling.
98
99
  - `lsc`:
99
100
  - `useGlslify`: default false. set to true if you need glslify of lsc files.
100
101
  - *NOTE* this is an experiment feature and may be removed ( move to standalone builder ) in the future.
package/dist/ext/pug.js CHANGED
@@ -21,6 +21,7 @@ pugbuild = function(opt){
21
21
  this.i18n = opt.i18n || null;
22
22
  this.intlbase = opt.intlbase || 'intl';
23
23
  this.filters = opt.filters || {};
24
+ this.locals = opt.locals || {};
24
25
  this.extapi = this.getExtapi();
25
26
  this.bundler = opt.bundler;
26
27
  this.init(import$({
@@ -55,7 +56,7 @@ pugbuild.prototype = import$(Object.create(base.prototype), {
55
56
  },
56
57
  getExtapi: function(){
57
58
  var ret, this$ = this;
58
- ret = {
59
+ ret = import$(import$({}, this.locals || {}), {
59
60
  plugins: [{
60
61
  resolve: function(){
61
62
  var args, res$, i$, to$;
@@ -239,7 +240,7 @@ pugbuild.prototype = import$(Object.create(base.prototype), {
239
240
  };
240
241
  return this$.bundler.addSpec(spec);
241
242
  }
242
- };
243
+ });
243
244
  if (this.i18n) {
244
245
  ret.i18n = function(it){
245
246
  return this$.i18n.t((it || '').trim());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "zbryikt",
3
3
  "name": "@plotdb/srcbuild",
4
- "version": "0.0.66",
4
+ "version": "0.0.67",
5
5
  "description": "",
6
6
  "main": "./dist/main.js",
7
7
  "files": [