chore(scripts/build): actually put sourceURL correctly
This commit is contained in:
parent
5987473580
commit
ff3a19f25f
1 changed files with 6 additions and 14 deletions
|
|
@ -75,7 +75,6 @@ export default async function build(dev = false, log = true) {
|
|||
}),
|
||||
importGlobPlugin(),
|
||||
swcPlugin(),
|
||||
sourceURLPlugin(),
|
||||
hermesCPlugin({
|
||||
flags: [
|
||||
dev ? '-Og' : '-O',
|
||||
|
|
@ -110,7 +109,9 @@ export default async function build(dev = false, log = true) {
|
|||
})
|
||||
|
||||
await bundle.write({
|
||||
minify: {},
|
||||
minify: {
|
||||
mangle: true,
|
||||
},
|
||||
file: 'dist/revenge.js',
|
||||
format: 'iife',
|
||||
})
|
||||
|
|
@ -123,18 +124,6 @@ export default async function build(dev = false, log = true) {
|
|||
)
|
||||
}
|
||||
|
||||
function sourceURLPlugin() {
|
||||
return {
|
||||
name: 'footer',
|
||||
renderChunk(code) {
|
||||
return {
|
||||
code: `${code}\n//# sourceURL=Revenge`,
|
||||
map: null,
|
||||
}
|
||||
},
|
||||
} satisfies RolldownPlugin
|
||||
}
|
||||
|
||||
function swcPlugin() {
|
||||
return {
|
||||
name: 'swc',
|
||||
|
|
@ -214,6 +203,9 @@ function hermesCPlugin({
|
|||
const file = bundle['revenge.js'] as OutputChunk
|
||||
if (!file || !file.code) throw new Error('No code to compile')
|
||||
|
||||
// TODO(scripts/build): Remove this when we have a better way to add sourceURL
|
||||
file.code += `//# sourceURL=Revenge`
|
||||
|
||||
const cmdlist = [
|
||||
`./node_modules/@unbound-mod/hermesc/${process.platform}/${binPath}`,
|
||||
'-emit-binary',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue