hw-weapp-compiler 1.0.5 → 1.0.6
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.
|
@@ -13,7 +13,6 @@ const entries = getEntries();
|
|
|
13
13
|
|
|
14
14
|
module.exports = async function loader(source) {
|
|
15
15
|
this.cacheable(true);
|
|
16
|
-
const callback = this.async();
|
|
17
16
|
const filePath = this.resourcePath;
|
|
18
17
|
const fileInfo = path.parse(filePath);
|
|
19
18
|
const sourceStr = source.toString();
|
|
@@ -46,7 +45,7 @@ module.exports = async function loader(source) {
|
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
return imports.join('');
|
|
50
49
|
};
|
|
51
50
|
|
|
52
51
|
module.exports.raw = true;
|
|
@@ -9,7 +9,6 @@ const { loadModule } = require('../utils/loadModule');
|
|
|
9
9
|
|
|
10
10
|
module.exports = async function loader(source) {
|
|
11
11
|
this.cacheable(true);
|
|
12
|
-
const callback = this.async();
|
|
13
12
|
const filePath = this.resourcePath;
|
|
14
13
|
let content = source.toString();
|
|
15
14
|
const {
|
|
@@ -46,6 +45,6 @@ module.exports = async function loader(source) {
|
|
|
46
45
|
// wxml文件 - 并行 loadModule
|
|
47
46
|
await Promise.all(wxmls.map(([, file]) => loadModule.call(this, file)));
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
return content;
|
|
50
49
|
};
|
|
51
50
|
module.exports.raw = true;
|
|
@@ -9,7 +9,6 @@ const { loadModule } = require('../utils/loadModule');
|
|
|
9
9
|
|
|
10
10
|
module.exports = async function loader(source) {
|
|
11
11
|
this.cacheable(true);
|
|
12
|
-
const callback = this.async();
|
|
13
12
|
const filePath = this.resourcePath;
|
|
14
13
|
const content = source.toString();
|
|
15
14
|
const fileInfo = path.parse(filePath);
|
|
@@ -26,6 +25,6 @@ module.exports = async function loader(source) {
|
|
|
26
25
|
}),
|
|
27
26
|
);
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
return content;
|
|
30
29
|
};
|
|
31
30
|
module.exports.raw = true;
|
package/build/plugin/index.js
CHANGED
|
@@ -7,17 +7,31 @@ const chalk = require('chalk');
|
|
|
7
7
|
function createCompilerHandler(label) {
|
|
8
8
|
return (err, stats) => {
|
|
9
9
|
if (err) {
|
|
10
|
+
console.error(chalk.red(`${label} failed with fatal error:`));
|
|
10
11
|
console.error(err);
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
if (stats.hasErrors()) {
|
|
15
|
-
console.
|
|
16
|
+
console.error(
|
|
16
17
|
stats.toString({
|
|
17
18
|
chunks: false,
|
|
18
19
|
colors: true,
|
|
19
20
|
}),
|
|
20
21
|
);
|
|
22
|
+
console.error(chalk.red(`${label} completed with errors`));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (stats.hasWarnings()) {
|
|
27
|
+
console.warn(
|
|
28
|
+
stats.toString({
|
|
29
|
+
chunks: false,
|
|
30
|
+
colors: true,
|
|
31
|
+
warnings: true,
|
|
32
|
+
errors: false,
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
21
35
|
}
|
|
22
36
|
|
|
23
37
|
console.log(chalk.green(`${label} completed in ${(stats.endTime - stats.startTime) / 1000} seconds`));
|