amxxpack 1.4.0 → 1.4.1
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/lib/builder/builder.js
CHANGED
|
@@ -405,6 +405,9 @@ var AmxxBuilder = /** @class */ (function () {
|
|
|
405
405
|
return __generator(this, function (_a) {
|
|
406
406
|
switch (_a.label) {
|
|
407
407
|
case 0:
|
|
408
|
+
if (!this.projectConfig.output.assets) {
|
|
409
|
+
return [2 /*return*/];
|
|
410
|
+
}
|
|
408
411
|
srcFile = path_1.default.relative(assetInput.dir, filePath);
|
|
409
412
|
if (assetInput.filter && !this.execPathFilter(srcFile, assetInput.filter)) {
|
|
410
413
|
return [2 /*return*/];
|
|
@@ -466,6 +469,9 @@ var AmxxBuilder = /** @class */ (function () {
|
|
|
466
469
|
return __generator(this, function (_c) {
|
|
467
470
|
switch (_c.label) {
|
|
468
471
|
case 0:
|
|
472
|
+
if (!this.projectConfig.output.plugins) {
|
|
473
|
+
return [2 /*return*/];
|
|
474
|
+
}
|
|
469
475
|
srcPath = path_1.default.join(srcDir, srcFile);
|
|
470
476
|
_a = path_1.default.parse(srcFile), scriptName = _a.name, srcNestedDir = _a.dir;
|
|
471
477
|
destDir = path_1.default.join(this.projectConfig.output.plugins, this.projectConfig.rules.flatCompilation ? '.' : srcNestedDir);
|
|
@@ -17,13 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
var lodash_1 = require("lodash");
|
|
18
18
|
var path_1 = __importDefault(require("path"));
|
|
19
19
|
var defaults_1 = __importDefault(require("./defaults"));
|
|
20
|
-
var mergeConfigFn = function (val1, val2) { return ((0, lodash_1.isNil)(val2) ? val1 : undefined); };
|
|
21
20
|
function resolve(overrides, projectDir) {
|
|
22
21
|
if (overrides === void 0) { overrides = {}; }
|
|
23
22
|
if (projectDir === void 0) { projectDir = ''; }
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
23
|
+
var config = (0, lodash_1.merge)({}, defaults_1.default, overrides);
|
|
24
|
+
var resolvePath = function (p) { return path_1.default.resolve(projectDir, p); };
|
|
25
|
+
var resolveOutputPath = function (p) { return ((0, lodash_1.isNull)(p) ? null : path_1.default.resolve(projectDir, config.output.base || '', p)); };
|
|
27
26
|
// resolve paths
|
|
28
27
|
var resolvedConfig = (0, lodash_1.merge)(config, {
|
|
29
28
|
input: {
|
|
@@ -33,10 +32,10 @@ function resolve(overrides, projectDir) {
|
|
|
33
32
|
? __assign(__assign({}, input), { dir: resolvePath(input.dir) }) : { dir: resolvePath(input) }); })
|
|
34
33
|
},
|
|
35
34
|
output: {
|
|
36
|
-
scripts:
|
|
37
|
-
plugins:
|
|
38
|
-
include:
|
|
39
|
-
assets:
|
|
35
|
+
scripts: resolveOutputPath(config.output.scripts),
|
|
36
|
+
plugins: resolveOutputPath(config.output.plugins),
|
|
37
|
+
include: resolveOutputPath(config.output.include),
|
|
38
|
+
assets: resolveOutputPath(config.output.assets)
|
|
40
39
|
},
|
|
41
40
|
include: (0, lodash_1.map)(config.include, resolvePath),
|
|
42
41
|
compiler: {
|