swico 0.2.2 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swico",
3
- "version": "0.2.2",
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",
@@ -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
- formatRouter = getFormatRouter(routes, templateType);
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)];