swico 0.2.1 → 0.3.0-beta1
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/package.json +3 -3
- package/src/utils/config.js +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swico",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-beta1",
|
|
4
4
|
"description": "Simple, efficient, and practical front-end framework",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"react": "~18.2.0",
|
|
34
34
|
"react-dom": "~18.2.0",
|
|
35
35
|
"react-router-dom": "6.4.5",
|
|
36
|
-
"@types/react": "18.2.0",
|
|
37
|
-
"@types/react-dom": "18.2.0",
|
|
38
36
|
"vue": "~3.4.14",
|
|
39
37
|
"vue-router": "^4.2.5",
|
|
40
38
|
"history": "5.3.0"
|
|
41
39
|
},
|
|
42
40
|
"devDependencies": {
|
|
41
|
+
"@types/react": "18.2.0",
|
|
42
|
+
"@types/react-dom": "18.2.0",
|
|
43
43
|
"@vue/compiler-sfc": "3.4.14",
|
|
44
44
|
"eslint-plugin-react": "7.33.2",
|
|
45
45
|
"eslint-plugin-react-hooks": "4.3.0",
|
package/src/utils/config.js
CHANGED
|
@@ -245,7 +245,18 @@ var formatTemplateFileText = function (_a, templateType) {
|
|
|
245
245
|
return __generator(this, function (_a) {
|
|
246
246
|
switch (_a.label) {
|
|
247
247
|
case 0:
|
|
248
|
-
|
|
248
|
+
if (templateType === 'react') {
|
|
249
|
+
formatRouter = [
|
|
250
|
+
{
|
|
251
|
+
path: '/',
|
|
252
|
+
component: "()=>import('".concat(projectPath, "/src/layout/index.tsx)"),
|
|
253
|
+
children: getFormatRouter(routes, templateType)
|
|
254
|
+
}
|
|
255
|
+
];
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
formatRouter = getFormatRouter(routes, templateType);
|
|
259
|
+
}
|
|
249
260
|
textData = "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = ".concat(JSON.stringify(formatRouter), ";");
|
|
250
261
|
modifiedText = textData.replace(/"(\(\)=>import\('[^']+'\))"/g, '$1');
|
|
251
262
|
return [4, (0, tools_1.writeFile)(path_1.default.resolve(__dirname, "../template/".concat(templateType, "/routes.js")), modifiedText)];
|