Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
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
wisdom-components
Commits
206e7c16
Commit
206e7c16
authored
Apr 21, 2021
by
邓晓峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add gen_less_entry
parent
21aefbe0
Pipeline
#26302
failed with stages
in 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
package.json
package.json
+1
-1
gen_less_entry.js
scripts/gen_less_entry.js
+23
-0
No files found.
package.json
View file @
206e7c16
...
...
@@ -6,7 +6,7 @@
],
"scripts"
:
{
"bootstrap"
:
"node ./scripts/bootstrap.js"
,
"build"
:
"
father-build && webpack
"
,
"build"
:
"
cross-env BUILD_TYPE=lib father-build && cross-env BUILD_TYPE=es father-build && webpack && node ./scripts/gen_less_entry.js
"
,
"changelog"
:
"pro-changelog"
,
"createRelease"
:
"node ./scripts/createRelease.js"
,
"deploy"
:
"npm run site && gh-pages -d ./dist"
,
...
...
scripts/gen_less_entry.js
0 → 100644
View file @
206e7c16
const
fs
=
require
(
'fs'
);
const
{
join
}
=
require
(
'path'
);
const
fg
=
require
(
'fast-glob'
);
const
pkgList
=
fs
.
readdirSync
(
join
(
__dirname
,
'../'
,
'packages'
))
.
filter
((
pkg
)
=>
pkg
.
charAt
(
0
)
!==
'.'
);
pkgList
.
map
(
async
(
path
)
=>
{
const
baseUrl
=
`
${
join
(
__dirname
,
'../'
,
'packages'
)}
/
${
path
}
/src`
;
const
lessFiles
=
await
fg
(
`
${
baseUrl
}
/**/*.less`
,
{
ignore
:
[
'**/demos/**'
],
deep
:
5
,
});
const
importFiles
=
lessFiles
.
map
((
lessPath
)
=>
{
return
`@import "../es
${
lessPath
.
replace
(
baseUrl
,
''
)}
";`
;
});
const
distPath
=
`
${
join
(
__dirname
,
'../'
,
'packages'
,
path
,
'dist'
,
`
${
path
}
.less`
)}
`
;
fs
.
writeFileSync
(
distPath
,
importFiles
.
join
(
'
\
n'
));
});
\ No newline at end of file
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