weboptimizer 2.0.1108 → 2.0.1109
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/configurator.d.ts +2 -2
- package/configurator.js +304 -283
- package/ejsLoader.js +6 -5
- package/index.d.ts +3 -1
- package/index.js +135 -117
- package/package.json +22 -2
- package/stylelintConfigurator.js +2 -1
- package/type.d.ts +5 -1
- package/webpackConfigurator.js +143 -143
package/ejsLoader.js
CHANGED
|
@@ -53,7 +53,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
53
53
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
54
54
|
|
|
55
55
|
// endregion
|
|
56
|
-
|
|
56
|
+
var configuration = (0, _configurator["default"])();
|
|
57
57
|
/**
|
|
58
58
|
* Main transformation function.
|
|
59
59
|
* @param this - Loader context.
|
|
@@ -61,6 +61,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
61
61
|
*
|
|
62
62
|
* @returns Transformed string.
|
|
63
63
|
*/
|
|
64
|
+
|
|
64
65
|
function _default(source) {
|
|
65
66
|
var _this = this;
|
|
66
67
|
|
|
@@ -116,13 +117,13 @@ function _default(source) {
|
|
|
116
117
|
|
|
117
118
|
delete nestedOptions.client;
|
|
118
119
|
nestedOptions = _clientnode["default"].extend(true, {
|
|
119
|
-
encoding:
|
|
120
|
+
encoding: configuration.encoding
|
|
120
121
|
}, nestedOptions, nestedLocals.options || {}, options);
|
|
121
122
|
if (nestedOptions.isString) return compile(template, nestedOptions)(nestedLocals);
|
|
122
123
|
|
|
123
124
|
var templateFilePath = _helper["default"].determineModuleFilePath(template, givenOptions.module.aliases, givenOptions.module.replacements, {
|
|
124
125
|
file: givenOptions.extensions.file.internal
|
|
125
|
-
}, givenOptions.context,
|
|
126
|
+
}, givenOptions.context, configuration.path.source.asset.base, configuration.path.ignore, configuration.module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding);
|
|
126
127
|
|
|
127
128
|
if (templateFilePath) {
|
|
128
129
|
if ('addDependency' in _this) _this.addDependency(templateFilePath);
|
|
@@ -183,7 +184,7 @@ function _default(source) {
|
|
|
183
184
|
stepLocals = localsIndex < givenLocals.length ? givenLocals[localsIndex] : {};
|
|
184
185
|
scope = {};
|
|
185
186
|
if (step < 3 && 1 < compileSteps) scope = _objectSpread({
|
|
186
|
-
configuration:
|
|
187
|
+
configuration: configuration,
|
|
187
188
|
Helper: _helper["default"],
|
|
188
189
|
include: require,
|
|
189
190
|
require: require,
|
|
@@ -199,7 +200,7 @@ function _default(source) {
|
|
|
199
200
|
var filePath = isString ? options.filename : result;
|
|
200
201
|
if (filePath && (0, _path.extname)(filePath) === '.js') result = eval('require')(filePath);else {
|
|
201
202
|
if (!isString) {
|
|
202
|
-
var encoding =
|
|
203
|
+
var encoding = configuration.encoding;
|
|
203
204
|
if (typeof options.encoding === 'string') encoding = options.encoding;
|
|
204
205
|
result = (0, _fs.readFileSync)(result, {
|
|
205
206
|
encoding: encoding
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env babel-node
|
|
2
2
|
/**
|
|
3
3
|
* Main entry point.
|
|
4
|
+
* @param context - Location from where to build current application.
|
|
5
|
+
*
|
|
4
6
|
* @returns Nothing.
|
|
5
7
|
*/
|
|
6
|
-
declare const main: () => Promise<void>;
|
|
8
|
+
declare const main: (context?: string | undefined) => Promise<void>;
|
|
7
9
|
export default main;
|