Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
e4f961dc
Commit
e4f961dc
authored
Nov 30, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复flat方法兼容性处理
parent
d716e650
Pipeline
#39085
passed with stages
in 23 minutes 37 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
index.js
internals/webpack/babel-preset/index.js
+13
-12
routes.js
src/utils/routes.js
+3
-0
No files found.
internals/webpack/babel-preset/index.js
View file @
e4f961dc
...
...
@@ -23,7 +23,8 @@ module.exports = opts => {
'@babel/preset-env'
,
{
...
mergeConfig
(
defaultEnvConfig
,{}),
modules
:
false
modules
:
false
,
...
opts
.
env
},
],
// opts.react && ['@babel/preset-react'],
...
...
@@ -56,17 +57,17 @@ module.exports = opts => {
'@babel/plugin-proposal-logical-assignment-operators'
,
'@babel/plugin-syntax-dynamic-import'
,
'@babel/plugin-transform-react-jsx'
,
//
opts.transformRuntime && [
//
'@babel/plugin-transform-runtime',
//
{
//
version: require('@babel/runtime/package.json').version,
//
absoluteRuntime: dirname(
//
require.resolve('@babel/runtime/package.json'),
//
),
//
useESModules: true,
//
...toObject(opts.transformRuntime),
//
},
//
],
opts
.
transformRuntime
&&
[
'@babel/plugin-transform-runtime'
,
{
version
:
require
(
'@babel/runtime/package.json'
).
version
,
absoluteRuntime
:
dirname
(
require
.
resolve
(
'@babel/runtime/package.json'
),
),
useESModules
:
true
,
...
toObject
(
opts
.
transformRuntime
),
},
],
[
'babel-plugin-transform-react-remove-prop-types'
,
{
...
...
src/utils/routes.js
View file @
e4f961dc
...
...
@@ -127,6 +127,9 @@ export function simpleNormalizeChildren(children) {
export
const
generFlatRoutes
=
(
widgets
,
parent
,
subSystem
,
modulePkg
)
=>
{
const
treeKeys
=
[];
const
flatMenu
=
[];
if
(
!
widgets
||
Array
.
isArray
(
widgets
)
&&
widgets
.
length
===
0
)
{
return
[];
}
(
widgets
||
[]).
forEach
(
item
=>
{
if
(
item
.
hasOwnProperty
(
'routes'
))
{
const
route
=
generFlatRoutes
(
item
.
routes
,
item
,
item
.
name
,
modulePkg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment