hw-weapp-compiler 1.0.11 → 1.0.12
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.
|
@@ -24,7 +24,7 @@ function collectStaticRequires(content) {
|
|
|
24
24
|
let ast;
|
|
25
25
|
let parseError = null;
|
|
26
26
|
try {
|
|
27
|
-
ast = acorn.parse(content, { ecmaVersion: '
|
|
27
|
+
ast = acorn.parse(content, { ecmaVersion: '2020', sourceType: 'script' });
|
|
28
28
|
} catch (error) {
|
|
29
29
|
parseError = error;
|
|
30
30
|
return { requires, parseError };
|
package/build/plugin/index.js
CHANGED
|
@@ -138,7 +138,7 @@ function injectSubpackageRequires(content, assetName, subpackages) {
|
|
|
138
138
|
const res = subpackages[subpackage];
|
|
139
139
|
|
|
140
140
|
if (
|
|
141
|
-
assetName.startsWith(subpackage) &&
|
|
141
|
+
(assetName === subpackage || assetName.startsWith(`${subpackage}/`)) &&
|
|
142
142
|
!/(subpackage_common\.(js|wxss))$/.test(assetName)
|
|
143
143
|
) {
|
|
144
144
|
if (
|
package/build/webpack.config.js
CHANGED
|
@@ -312,7 +312,6 @@ module.exports = async (options, { analyzer, quiet } = {}) => {
|
|
|
312
312
|
{
|
|
313
313
|
loader: require.resolve('swc-loader'),
|
|
314
314
|
options: {
|
|
315
|
-
cacheDirectory: true,
|
|
316
315
|
// 用 env 模式按 chrome 53 降级,等价原 babel preset-env targets.chrome53。
|
|
317
316
|
// 关闭 externalHelpers:helper 内联进每个使用文件,不 require("@swc/helpers"),
|
|
318
317
|
// 也不产 regeneratorRuntime(chrome 53 原生支持 function*)。
|