FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
adminforth/adminforth/commands/bundle.js at bugfix/unsuitable-type · devforth/adminforth · GitHub
devforth
adminforth
Repository navigation
Code
Issues
16
(16)
Pull requests
4
(4)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
adminforth
/
adminforth
/
commands
/
bundle.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (26 loc) · 758 Bytes
Breadcrumbs
adminforth
/
adminforth
/
commands
/
bundle.js
Copy path
File metadata and controls
29 lines (26 loc) · 758 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import
fs
from
"fs"
;
import
{
getInstance
}
from
"./utils.js"
;
async
function
bundle
(
)
{
const
currentDirectory
=
process
.
cwd
(
)
;
const
files
=
fs
.
readdirSync
(
currentDirectory
)
;
let
instanceFound
=
false
;
for
(
const
file
of
files
)
{
if
(
file
.
endsWith
(
".js"
)
||
file
.
endsWith
(
".ts"
)
)
{
try
{
const
instance
=
await
getInstance
(
file
,
currentDirectory
)
;
if
(
instance
)
{
await
instance
.
bundleNow
(
{
hotReload
:
false
}
)
;
instanceFound
=
true
;
break
;
}
}
catch
(
error
)
{
console
.
error
(
`Error: Could not bundle '
${
file
}
'`
,
error
)
;
}
}
}
if
(
!
instanceFound
)
{
console
.
error
(
"Error: No valid instance found to bundle."
)
;
return
;
}
}
export
default
bundle
;
Back
|
FazBrowse Home
|
New Git URL