Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188562
frontend-ts-builder.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
frontend-ts-builder.ts
View Options
import
{
generateStimulusControllers
}
from
"../generate-stimulus.js"
;
import
{
promises
as
fs
}
from
"fs"
;
import
{
build
}
from
"esbuild"
;
import
{
Builder
}
from
"./builder.js"
;
import
{
relative
}
from
"node:path"
;
export
class
FrontendTSBuilder
extends
Builder
{
constructor
(
public
project_dir
:
string
,
public
style_dirs
:
string
[],
public
controller_dirs
:
string
[]
)
{
super
(
project_dir
,
style_dirs
);
}
getName
()
:
string
{
return
"frontend-ts"
;
}
ownsFile
(
file_path
:
string
)
{
return
(
file_path
.
startsWith
(
"src/front"
)
||
file_path
.
endsWith
(
".stimulus.ts"
)
);
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
async
dispose
()
:
Promise
<
void
>
{}
async
_build
()
:
Promise
<
void
>
{
await
generateStimulusControllers
(
this
.
controller_dirs
);
const
{
metafile
}
=
await
build
({
entryPoints
:
[
"./src/front/index.ts"
],
sourcemap
:
true
,
outfile
:
"./public/dist/bundle.js"
,
logLevel
:
"info"
,
bundle
:
true
,
minify
:
true
,
metafile
:
true
,
treeShaking
:
true
,
});
await
fs
.
writeFile
(
relative
(
this
.
project_dir
,
"dist"
)
+
"/"
+
"front"
+
".meta.json"
,
JSON
.
stringify
(
metafile
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 08:16 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
643149
Default Alt Text
frontend-ts-builder.ts (1 KB)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment