@plotdb/srcbuild 0.0.68 → 0.0.69
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 +4 -1
- package/dist/ext/pug.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ Except common options, each builder may support different options:
|
|
|
83
83
|
- `intlbase`: base dir to place i18n files. for example, `intl` part of `/intl/zh-TW/index.html`. default `intl`.
|
|
84
84
|
- `i18n`: an optional i18n object having the same interface with `i18next`
|
|
85
85
|
- when provided, enable i18n building with following additional features:
|
|
86
|
-
-
|
|
86
|
+
- if `buildIntl` is set to true, build source files to locations by i18n config like `/intl/zh-TW/index.html`.
|
|
87
87
|
- an additional function `i18n` will be available during pug compilation.
|
|
88
88
|
- `i18n(text)`: translate `text` based on the `i18n` object provided.
|
|
89
89
|
- `language()`: return current language. ( e.g., `zh-TW` )
|
|
@@ -92,7 +92,10 @@ Except common options, each builder may support different options:
|
|
|
92
92
|
- additionally, a pug filter `i18n` is also available, which can be used like:
|
|
93
93
|
|
|
94
94
|
span:i18n translate this text
|
|
95
|
+
|
|
95
96
|
- `noView`: default false. when true, js view files ( generated to `viewdir` ) won't be built.
|
|
97
|
+
- `buildIntl`: default true. when true build locale-based files under `static/intl/` and `.view/intl`
|
|
98
|
+
- requires `i18n`; omitted if `i18n` is not available
|
|
96
99
|
- `viewdir`: default `.view`. a directory for storing prebuilt pug files ( in .js format )
|
|
97
100
|
- `bundler`: default null. Auto packing will be possible only if this is provided.
|
|
98
101
|
- `locals`: additional local variables for pug context when compiling.
|
package/dist/ext/pug.js
CHANGED
|
@@ -30,6 +30,7 @@ pugbuild = function(opt){
|
|
|
30
30
|
}, opt));
|
|
31
31
|
this.viewdir = path.normalize(path.join(this.base, opt.viewdir || '.view'));
|
|
32
32
|
this._noView = opt.noView || false;
|
|
33
|
+
this._buildIntl = opt.buildIntl != null ? opt.buildIntl : true;
|
|
33
34
|
return this;
|
|
34
35
|
};
|
|
35
36
|
pugbuild.prototype = import$(Object.create(base.prototype), {
|
|
@@ -381,7 +382,7 @@ pugbuild.prototype = import$(Object.create(base.prototype), {
|
|
|
381
382
|
return results$;
|
|
382
383
|
});
|
|
383
384
|
};
|
|
384
|
-
lngs = [''].concat(this.i18n
|
|
385
|
+
lngs = [''].concat(this.i18n && this._buildIntl
|
|
385
386
|
? ((ref$ = this.i18n).options || (ref$.options = {})).lng || []
|
|
386
387
|
: []);
|
|
387
388
|
consume = function(i){
|
|
@@ -423,7 +424,7 @@ pugbuild.prototype = import$(Object.create(base.prototype), {
|
|
|
423
424
|
}
|
|
424
425
|
});
|
|
425
426
|
};
|
|
426
|
-
lngs = [''].concat(this.i18n
|
|
427
|
+
lngs = [''].concat(this.i18n && this._buildIntl
|
|
427
428
|
? ((ref$ = this.i18n).options || (ref$.options = {})).lng || []
|
|
428
429
|
: []);
|
|
429
430
|
consume = function(i){
|