@next-core/build-next-bricks 1.23.14 → 1.25.0
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/bin/copy-jsx-d-ts.js +26 -0
- package/index.d.ts +1 -0
- package/package.json +4 -3
- package/src/build.js +11 -6
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { copyFile } from "node:fs/promises";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
const packageDir = process.cwd();
|
|
7
|
+
const jsxDtsSrc = path.join(packageDir, "src", "jsx.d.ts");
|
|
8
|
+
const jsxDtsDestDir = path.join(packageDir, "dist-types");
|
|
9
|
+
const jsxDtsDest = path.join(jsxDtsDestDir, "jsx.d.ts");
|
|
10
|
+
|
|
11
|
+
async function copyJsxDts() {
|
|
12
|
+
try {
|
|
13
|
+
if (!existsSync(jsxDtsSrc)) {
|
|
14
|
+
console.log(`Source file ${jsxDtsSrc} does not exist. Skipping copy.`);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
await copyFile(jsxDtsSrc, jsxDtsDest);
|
|
19
|
+
console.log(`Copied ${jsxDtsSrc} to ${jsxDtsDest}`);
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error("Error copying jsx.d.ts:", error);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
copyJsxDts();
|
package/index.d.ts
CHANGED
|
@@ -89,6 +89,7 @@ export interface BuildNextBricksConfig {
|
|
|
89
89
|
imageAssetFilename?: string | ((pathData: any, assetInfo: any) => string);
|
|
90
90
|
plugins?: Configuration["plugins"];
|
|
91
91
|
moduleRules?: RuleSetRule[];
|
|
92
|
+
oneOfRulesForBabel?: RuleSetRule[];
|
|
92
93
|
resolve?: ResolveOptions;
|
|
93
94
|
exposes?: ConstructorParameters<
|
|
94
95
|
typeof container.ModuleFederationPlugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/build-next-bricks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Build next bricks",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/build-next-bricks",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"bin": {
|
|
10
10
|
"build-next-bricks": "./bin/build-next-bricks.js",
|
|
11
11
|
"pre-build-next-bricks": "./bin/pre-build-next-bricks.js",
|
|
12
|
-
"post-build-next-bricks": "./bin/post-build-next-bricks.js"
|
|
12
|
+
"post-build-next-bricks": "./bin/post-build-next-bricks.js",
|
|
13
|
+
"copy-jsx-d-ts": "./bin/copy-jsx-d-ts.js"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
16
|
"bin",
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
"peerDependencies": {
|
|
62
63
|
"@next-shared/common-bricks": "*"
|
|
63
64
|
},
|
|
64
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "69a1f401518c74aa11b0d0bc7b03df99ad555373"
|
|
65
66
|
}
|
package/src/build.js
CHANGED
|
@@ -358,12 +358,17 @@ async function getWebpackConfig(config) {
|
|
|
358
358
|
],
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
361
|
+
oneOf: [
|
|
362
|
+
...(config.oneOfRulesForBabel ?? []),
|
|
363
|
+
{
|
|
364
|
+
test: /\.[tj]sx?$/,
|
|
365
|
+
loader: "babel-loader",
|
|
366
|
+
exclude: /node_modules|\.d\.ts$/,
|
|
367
|
+
options: {
|
|
368
|
+
rootMode: "upward",
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
],
|
|
367
372
|
},
|
|
368
373
|
{
|
|
369
374
|
// Images
|