falcon-webpack
Advanced tools
@@ -13,2 +13,3 @@ const ts = require('typescript'); | ||
| name | ||
| .replace(/^\./g, '') | ||
| .replace(/^\//g, '') | ||
@@ -28,2 +29,3 @@ .replace(/\/$/g, '') | ||
| name | ||
| .replace(/\./g, '') | ||
| .replace(/\?/g, '') | ||
@@ -70,4 +72,4 @@ .replace(/\/$/g, '') | ||
| }); | ||
| route.name = toHump(route.path); | ||
| route.chunkName = toLine(route.path); | ||
| route.name = toHump(route.path || route.require); | ||
| route.chunkName = toLine(route.path || route.require); | ||
| return route; | ||
@@ -119,3 +121,3 @@ }); | ||
| str += `\n{ | ||
| name: '${route.name}',\npath: '${route.path}',\n${ | ||
| name: '${route.name}',\n${route.path ? 'path: \'' + route.path + '\',\n' : ''}${ | ||
| route.strict ? 'strict: true,\n' : ''}${ | ||
@@ -148,4 +150,4 @@ route.exact ? 'exact: true,\n' : ''}${ | ||
| * <Switch> | ||
| * <Route path="/acct/" strict exact componnent={Acct} /> | ||
| * <Route path="/acct/finance" componnent={AcctFinance} /> | ||
| * <Route path="/acct/" strict exact component={Acct} /> | ||
| * <Route path="/acct/finance" component={AcctFinance} /> | ||
| * </Switch> | ||
@@ -175,7 +177,11 @@ * ); | ||
| routes.forEach(route => { | ||
| str += `\n<Route path = "${route.path}" ${route.strict ? 'strict' : ''} ${route.exact ? 'exact' : ''} ${route.sensitive ? 'sensitive' : ''} componnent = { ${route.name}}>`; | ||
| str += `\n<Route ${route.path ? 'path = "' + route.path + '"' : ''} ${route.strict ? 'strict' : ''} ${route.exact ? 'exact' : ''} ${route.sensitive ? 'sensitive' : ''} component = { ${route.name}}`; | ||
| if (route && route.routes) { | ||
| str += '>'; | ||
| str += tranversal(route.routes); | ||
| str += `</Route>`; | ||
| } else { | ||
| str += ' />'; | ||
| } | ||
| str += `</Route>`; | ||
| }); | ||
@@ -182,0 +188,0 @@ str += `\n</Switch>`; |
+1
-1
| { | ||
| "name": "falcon-webpack", | ||
| "version": "0.3.9", | ||
| "version": "0.3.10", | ||
| "description": "千米电商云前端框架-webpack插件集&loader", | ||
@@ -5,0 +5,0 @@ "mail": "gcy [guocaoyi@qianmi.com]", |
27363
0.73%872
0.58%