mam 1.11.950 → 1.11.952
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/node.deps.json +1 -1
- package/node.js +18 -7
- package/node.js.map +1 -1
- package/node.mjs +18 -7
- package/node.test.js +18 -7
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.mjs
CHANGED
|
@@ -7623,6 +7623,20 @@ var $;
|
|
|
7623
7623
|
var sources = this.sources_js([path, exclude]);
|
|
7624
7624
|
if (sources.length === 0)
|
|
7625
7625
|
return [];
|
|
7626
|
+
const errors = [];
|
|
7627
|
+
const contents = [];
|
|
7628
|
+
for (const src of sources) {
|
|
7629
|
+
if (bundle === 'node' && /node_modules\//.test(src.relate(this.root())))
|
|
7630
|
+
continue;
|
|
7631
|
+
try {
|
|
7632
|
+
contents.push({ src, content: this.js_content(src.path()) });
|
|
7633
|
+
}
|
|
7634
|
+
catch (error) {
|
|
7635
|
+
if ($mol_promise_like(error))
|
|
7636
|
+
$mol_fail_hidden(error);
|
|
7637
|
+
errors.push(error);
|
|
7638
|
+
}
|
|
7639
|
+
}
|
|
7626
7640
|
var concater = new $mol_sourcemap_builder(this.root().relate(targetJS.parent()), ';');
|
|
7627
7641
|
concater.add('#!/usr/bin/env node\n"use strict"');
|
|
7628
7642
|
if (bundle === 'node') {
|
|
@@ -7631,12 +7645,8 @@ var $;
|
|
|
7631
7645
|
else {
|
|
7632
7646
|
concater.add('function require' + '( path ){ return $node[ path ] }');
|
|
7633
7647
|
}
|
|
7634
|
-
const
|
|
7635
|
-
for (const src of sources) {
|
|
7636
|
-
if (bundle === 'node' && /node_modules\//.test(src.relate(this.root())))
|
|
7637
|
-
continue;
|
|
7648
|
+
for (const { src, content } of contents) {
|
|
7638
7649
|
try {
|
|
7639
|
-
const content = this.js_content(src.path());
|
|
7640
7650
|
const isCommonJs = /typeof +exports|module\.exports|\bexports\.\w+\s*=/.test(content.text);
|
|
7641
7651
|
if (isCommonJs) {
|
|
7642
7652
|
concater.add(`\nvar $node = $node || {}\nvoid function( module ) { var exports = module.${''}exports = this; function require( id ) { return $node[ id.replace( /^.\\// , "` + src.parent().relate(this.root().resolve('node_modules')) + `/" ) ] }; \n`, '-');
|
|
@@ -7649,8 +7659,9 @@ var $;
|
|
|
7649
7659
|
}
|
|
7650
7660
|
}
|
|
7651
7661
|
catch (error) {
|
|
7652
|
-
if ($
|
|
7653
|
-
|
|
7662
|
+
if ($mol_promise_like(error))
|
|
7663
|
+
$mol_fail_hidden(error);
|
|
7664
|
+
errors.push(error);
|
|
7654
7665
|
}
|
|
7655
7666
|
}
|
|
7656
7667
|
if (errors.length) {
|
package/node.test.js
CHANGED
|
@@ -7614,6 +7614,20 @@ var $;
|
|
|
7614
7614
|
var sources = this.sources_js([path, exclude]);
|
|
7615
7615
|
if (sources.length === 0)
|
|
7616
7616
|
return [];
|
|
7617
|
+
const errors = [];
|
|
7618
|
+
const contents = [];
|
|
7619
|
+
for (const src of sources) {
|
|
7620
|
+
if (bundle === 'node' && /node_modules\//.test(src.relate(this.root())))
|
|
7621
|
+
continue;
|
|
7622
|
+
try {
|
|
7623
|
+
contents.push({ src, content: this.js_content(src.path()) });
|
|
7624
|
+
}
|
|
7625
|
+
catch (error) {
|
|
7626
|
+
if ($mol_promise_like(error))
|
|
7627
|
+
$mol_fail_hidden(error);
|
|
7628
|
+
errors.push(error);
|
|
7629
|
+
}
|
|
7630
|
+
}
|
|
7617
7631
|
var concater = new $mol_sourcemap_builder(this.root().relate(targetJS.parent()), ';');
|
|
7618
7632
|
concater.add('#!/usr/bin/env node\n"use strict"');
|
|
7619
7633
|
if (bundle === 'node') {
|
|
@@ -7622,12 +7636,8 @@ var $;
|
|
|
7622
7636
|
else {
|
|
7623
7637
|
concater.add('function require' + '( path ){ return $node[ path ] }');
|
|
7624
7638
|
}
|
|
7625
|
-
const
|
|
7626
|
-
for (const src of sources) {
|
|
7627
|
-
if (bundle === 'node' && /node_modules\//.test(src.relate(this.root())))
|
|
7628
|
-
continue;
|
|
7639
|
+
for (const { src, content } of contents) {
|
|
7629
7640
|
try {
|
|
7630
|
-
const content = this.js_content(src.path());
|
|
7631
7641
|
const isCommonJs = /typeof +exports|module\.exports|\bexports\.\w+\s*=/.test(content.text);
|
|
7632
7642
|
if (isCommonJs) {
|
|
7633
7643
|
concater.add(`\nvar $node = $node || {}\nvoid function( module ) { var exports = module.${''}exports = this; function require( id ) { return $node[ id.replace( /^.\\// , "` + src.parent().relate(this.root().resolve('node_modules')) + `/" ) ] }; \n`, '-');
|
|
@@ -7640,8 +7650,9 @@ var $;
|
|
|
7640
7650
|
}
|
|
7641
7651
|
}
|
|
7642
7652
|
catch (error) {
|
|
7643
|
-
if ($
|
|
7644
|
-
|
|
7653
|
+
if ($mol_promise_like(error))
|
|
7654
|
+
$mol_fail_hidden(error);
|
|
7655
|
+
errors.push(error);
|
|
7645
7656
|
}
|
|
7646
7657
|
}
|
|
7647
7658
|
if (errors.length) {
|