weboptimizer 2.0.1181 → 2.0.1184
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 +4 -1
- package/index.d.ts +4 -1
- package/index.js +0 -16
- package/package.json +1 -1
- package/webpackConfigurator.js +2 -2
package/configurator.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="webpack-env" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
3
6
|
import { ResolvedConfiguration } from './type';
|
|
4
7
|
export declare let loadedConfiguration: null | ResolvedConfiguration;
|
|
5
8
|
/**
|
|
@@ -13,7 +16,7 @@ export declare let loadedConfiguration: null | ResolvedConfiguration;
|
|
|
13
16
|
*
|
|
14
17
|
* @returns Nothing.
|
|
15
18
|
*/
|
|
16
|
-
export declare const load: (context?: string
|
|
19
|
+
export declare const load: (context?: string, currentWorkingDirectory?: string, commandLineArguments?: Array<string>, webOptimizerPath?: string, environment?: NodeJS.ProcessEnv) => ResolvedConfiguration;
|
|
17
20
|
/**
|
|
18
21
|
* Get cached or determined configuration object.
|
|
19
22
|
* @returns Nothing.
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env babel-node
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="webpack-env" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
/// <reference types="node" />
|
|
6
|
+
/// <reference types="node" />
|
|
4
7
|
/**
|
|
5
8
|
* Main entry point.
|
|
6
9
|
* @param context - Location from where to build current application.
|
|
@@ -12,5 +15,5 @@
|
|
|
12
15
|
*
|
|
13
16
|
* @returns Nothing.
|
|
14
17
|
*/
|
|
15
|
-
declare const main: (context?: string
|
|
18
|
+
declare const main: (context?: string, currentWorkingDirectory?: string, commandLineArguments?: Array<string>, webOptimizerPath?: string, environment?: NodeJS.ProcessEnv) => Promise<() => void>;
|
|
16
19
|
export default main;
|
package/index.js
CHANGED
|
@@ -170,7 +170,6 @@ var main = /*#__PURE__*/function () {
|
|
|
170
170
|
case 22:
|
|
171
171
|
additionalArguments = commandLineArguments.splice(3); /// region register exit handler to tidy up
|
|
172
172
|
|
|
173
|
-
/// region register exit handler to tidy up
|
|
174
173
|
clear = function clear(error) {
|
|
175
174
|
// NOTE: Close handler have to be synchronous.
|
|
176
175
|
if (_clientnode["default"].isFileSync(filePath)) (0, _fs.unlinkSync)(filePath);
|
|
@@ -439,10 +438,6 @@ var main = /*#__PURE__*/function () {
|
|
|
439
438
|
*/
|
|
440
439
|
|
|
441
440
|
|
|
442
|
-
/*
|
|
443
|
-
NOTE: Close handler have to be
|
|
444
|
-
synchronous.
|
|
445
|
-
*/
|
|
446
441
|
if (configuration.buildContext.types[type].outputExtension === 'js' && _clientnode["default"].isFileSync(_filePath3)) (0, _fs.chmodSync)(_filePath3, '755');
|
|
447
442
|
}
|
|
448
443
|
}
|
|
@@ -491,10 +486,6 @@ var main = /*#__PURE__*/function () {
|
|
|
491
486
|
final productive output.
|
|
492
487
|
*/
|
|
493
488
|
|
|
494
|
-
/*
|
|
495
|
-
Triggers complete asset compiling and bundles them into the
|
|
496
|
-
final productive output.
|
|
497
|
-
*/
|
|
498
489
|
processPromises.push(new Promise(function (resolve, reject) {
|
|
499
490
|
var commandLineArguments = (configuration.commandLine.build.arguments || []).concat(additionalArguments);
|
|
500
491
|
console.info('Running "' + ("".concat(configuration.commandLine.build.command, " ") + commandLineArguments.join(' ')).trim() + '"');
|
|
@@ -503,10 +494,6 @@ var main = /*#__PURE__*/function () {
|
|
|
503
494
|
account.
|
|
504
495
|
*/
|
|
505
496
|
|
|
506
|
-
/*
|
|
507
|
-
NOTE: Take current weboptimizer's dependencies into
|
|
508
|
-
account.
|
|
509
|
-
*/
|
|
510
497
|
childProcessOptions.env.PATH += ":".concat(webOptimizerPath, "/node_modules/.bin");
|
|
511
498
|
var childProcess = (0, _child_process.spawn)(configuration.commandLine.build.command, commandLineArguments, childProcessOptions);
|
|
512
499
|
|
|
@@ -520,7 +507,6 @@ var main = /*#__PURE__*/function () {
|
|
|
520
507
|
var sourcePath = (0, _path.join)(configuration.path.source.base, _filePath5);
|
|
521
508
|
var targetPath = (0, _path.join)(configuration.path.target.base, _filePath5); // NOTE: Close handler have to be synchronous.
|
|
522
509
|
|
|
523
|
-
// NOTE: Close handler have to be synchronous.
|
|
524
510
|
if (_clientnode["default"].isDirectorySync(sourcePath)) {
|
|
525
511
|
if (_clientnode["default"].isDirectorySync(targetPath)) (0, _rimraf.sync)(targetPath, {
|
|
526
512
|
glob: false
|
|
@@ -617,8 +603,6 @@ var main = /*#__PURE__*/function () {
|
|
|
617
603
|
// region handle remaining tasks
|
|
618
604
|
|
|
619
605
|
|
|
620
|
-
// endregion
|
|
621
|
-
// region handle remaining tasks
|
|
622
606
|
handleTask = function handleTask(type) {
|
|
623
607
|
var tasks = Array.isArray(configuration.commandLine[type]) ? configuration.commandLine[type] : [configuration.commandLine[type]];
|
|
624
608
|
|
package/package.json
CHANGED
package/webpackConfigurator.js
CHANGED
|
@@ -1327,12 +1327,12 @@ var webpackConfiguration = _clientnode["default"].extend(true, {
|
|
|
1327
1327
|
chunkIds: configuration.debug ? 'named' : 'total-size',
|
|
1328
1328
|
moduleIds: configuration.debug ? 'named' : 'size',
|
|
1329
1329
|
// region common chunks
|
|
1330
|
-
splitChunks: !configuration.injection.chunks || configuration.targetTechnology.payload === 'node' || configuration.givenCommandLineArguments[2] === 'test' ? {
|
|
1330
|
+
splitChunks: _clientnode["default"].extend(true, !configuration.injection.chunks || configuration.targetTechnology.payload === 'node' || configuration.givenCommandLineArguments[2] === 'test' ? {
|
|
1331
1331
|
cacheGroups: {
|
|
1332
1332
|
"default": false,
|
|
1333
1333
|
defaultVendors: false
|
|
1334
1334
|
}
|
|
1335
|
-
} :
|
|
1335
|
+
} : {
|
|
1336
1336
|
chunks: 'all',
|
|
1337
1337
|
cacheGroups: {
|
|
1338
1338
|
defaultVendors: {
|