app-bundler 0.2.1 → 0.2.3
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/bundler.js +8 -5
- package/lib/cli.js +8 -5
- package/package.json +1 -1
package/lib/bundler.js
CHANGED
|
@@ -350,11 +350,7 @@ exports.path_removeQuery = path_removeQuery;
|
|
|
350
350
|
;
|
|
351
351
|
function path_changeExtension(path, ext) {
|
|
352
352
|
let str = ext ? '.' + ext : '';
|
|
353
|
-
|
|
354
|
-
if (i === -1) {
|
|
355
|
-
return path + str;
|
|
356
|
-
}
|
|
357
|
-
return path.substring(0, i) + str;
|
|
353
|
+
return path.replace(/(\.\w+)+$/, str);
|
|
358
354
|
}
|
|
359
355
|
exports.path_changeExtension = path_changeExtension;
|
|
360
356
|
function path_toAbsolute(path, parentLocation, rootLocation) {
|
|
@@ -2615,6 +2611,7 @@ class SolutionOpts extends SolutionOptsBase {
|
|
|
2615
2611
|
mainPage: 'main',
|
|
2616
2612
|
mainBundle: '',
|
|
2617
2613
|
mainContent: null,
|
|
2614
|
+
ignore: null,
|
|
2618
2615
|
outputBase: '',
|
|
2619
2616
|
outputAppBase: '/',
|
|
2620
2617
|
output: '',
|
|
@@ -11605,6 +11602,12 @@ var ResourceLoader;
|
|
|
11605
11602
|
? Configuration_1.Configuration.Instance.get('readDirectory')
|
|
11606
11603
|
: Configuration_1.Configuration.Instance.get('readFile');
|
|
11607
11604
|
let content = await reader(this.resource.filename, this.opts);
|
|
11605
|
+
if (this.resource.isGlob && Array.isArray(content) && this.solution.opts.ignore) {
|
|
11606
|
+
let rgxArr = this.solution.opts.ignore.map(path => new RegExp(path, 'i'));
|
|
11607
|
+
content = content.filter(path => {
|
|
11608
|
+
return rgxArr.some(rgx => rgx.test(path)) === false;
|
|
11609
|
+
});
|
|
11610
|
+
}
|
|
11608
11611
|
let handler = this.solution.handlers.find(x => x.parser.accepts(this.resource.type));
|
|
11609
11612
|
if (((_a = handler === null || handler === void 0 ? void 0 : handler.parser) === null || _a === void 0 ? void 0 : _a.transpile) != null) {
|
|
11610
11613
|
let result = await handler.parser.transpile(content, this.resource);
|
package/lib/cli.js
CHANGED
|
@@ -352,11 +352,7 @@ exports.path_removeQuery = path_removeQuery;
|
|
|
352
352
|
;
|
|
353
353
|
function path_changeExtension(path, ext) {
|
|
354
354
|
let str = ext ? '.' + ext : '';
|
|
355
|
-
|
|
356
|
-
if (i === -1) {
|
|
357
|
-
return path + str;
|
|
358
|
-
}
|
|
359
|
-
return path.substring(0, i) + str;
|
|
355
|
+
return path.replace(/(\.\w+)+$/, str);
|
|
360
356
|
}
|
|
361
357
|
exports.path_changeExtension = path_changeExtension;
|
|
362
358
|
function path_toAbsolute(path, parentLocation, rootLocation) {
|
|
@@ -2617,6 +2613,7 @@ class SolutionOpts extends SolutionOptsBase {
|
|
|
2617
2613
|
mainPage: 'main',
|
|
2618
2614
|
mainBundle: '',
|
|
2619
2615
|
mainContent: null,
|
|
2616
|
+
ignore: null,
|
|
2620
2617
|
outputBase: '',
|
|
2621
2618
|
outputAppBase: '/',
|
|
2622
2619
|
output: '',
|
|
@@ -11607,6 +11604,12 @@ var ResourceLoader;
|
|
|
11607
11604
|
? Configuration_1.Configuration.Instance.get('readDirectory')
|
|
11608
11605
|
: Configuration_1.Configuration.Instance.get('readFile');
|
|
11609
11606
|
let content = await reader(this.resource.filename, this.opts);
|
|
11607
|
+
if (this.resource.isGlob && Array.isArray(content) && this.solution.opts.ignore) {
|
|
11608
|
+
let rgxArr = this.solution.opts.ignore.map(path => new RegExp(path, 'i'));
|
|
11609
|
+
content = content.filter(path => {
|
|
11610
|
+
return rgxArr.some(rgx => rgx.test(path)) === false;
|
|
11611
|
+
});
|
|
11612
|
+
}
|
|
11610
11613
|
let handler = this.solution.handlers.find(x => x.parser.accepts(this.resource.type));
|
|
11611
11614
|
if (((_a = handler === null || handler === void 0 ? void 0 : handler.parser) === null || _a === void 0 ? void 0 : _a.transpile) != null) {
|
|
11612
11615
|
let result = await handler.parser.transpile(content, this.resource);
|