FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
postprocessing/esbuild.mjs at main · codeTCbin25/postprocessing · GitHub
codeTCbin25
/
postprocessing
Public
forked from
donmccurdy/postprocessing
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
postprocessing
/
esbuild.mjs
Copy path
More file actions
More file actions
Latest commit
History
History
History
121 lines (111 loc) · 2.86 KB
Breadcrumbs
postprocessing
/
esbuild.mjs
Copy path
File metadata and controls
121 lines (111 loc) · 2.86 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import
{
createRequire
}
from
"module"
;
import
{
glsl
}
from
"esbuild-plugin-glsl"
;
import
tsPaths
from
"esbuild-ts-paths"
;
import
glob
from
"tiny-glob"
;
import
esbuild
from
"esbuild"
;
const
require
=
createRequire
(
import
.
meta
.
url
)
;
const
pkg
=
require
(
"./package"
)
;
const
date
=
(
new
Date
(
)
)
.
toDateString
(
)
;
const
external
=
Object
.
keys
(
pkg
.
peerDependencies
||
{
}
)
;
const
minify
=
process
.
argv
.
includes
(
"-m"
)
;
const
watch
=
process
.
argv
.
includes
(
"-w"
)
;
const
plugins
=
[
glsl
(
{
minify
}
)
,
tsPaths
(
)
]
;
const
banner
=
`/**
*
${
pkg
.
name
}
v
${
pkg
.
version
}
build
${
date
}
*
${
pkg
.
homepage
}
* Copyright 2015-
${
date
.
slice
(
-
4
)
}
${
pkg
.
author
.
name
}
* @license
${
pkg
.
license
}
*/`
;
await
esbuild
.
build
(
{
entryPoints
:
await
glob
(
"src/**/worker.js"
)
,
outExtension
:
{
".js"
:
".txt"
}
,
outdir
:
"tmp"
,
target
:
"es6"
,
logLevel
:
"info"
,
format
:
"iife"
,
bundle
:
true
,
minify
,
watch
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
await
esbuild
.
build
(
{
entryPoints
:
[
"demo/src/index.js"
]
,
outdir
:
"public/demo"
,
target
:
"es6"
,
logLevel
:
"info"
,
format
:
"iife"
,
bundle
:
true
,
plugins
,
minify
,
watch
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
await
esbuild
.
build
(
{
entryPoints
:
[
"manual/js/libs/three.js"
]
,
outdir
:
"manual/assets/js/libs"
,
globalName
:
"THREE"
,
target
:
"es6"
,
logLevel
:
"info"
,
format
:
"iife"
,
bundle
:
true
,
minify
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
await
esbuild
.
build
(
{
entryPoints
:
[
"manual/js/src/index.js"
]
.
concat
(
await
glob
(
"manual/js/src/demos/*.js"
)
)
,
outdir
:
"manual/assets/js"
,
logLevel
:
"info"
,
format
:
"iife"
,
target
:
"es6"
,
bundle
:
true
,
external
,
plugins
,
minify
,
watch
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
await
esbuild
.
build
(
{
entryPoints
:
[
"src/index.js"
]
,
outfile
:
`build/
${
pkg
.
name
}
.esm.js`
,
banner
:
{
js
:
banner
}
,
logLevel
:
"info"
,
format
:
"esm"
,
bundle
:
true
,
external
,
plugins
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
await
esbuild
.
build
(
{
entryPoints
:
[
"src/index.js"
]
,
outfile
:
`build/
${
pkg
.
name
}
.mjs`
,
banner
:
{
js
:
banner
}
,
logLevel
:
"info"
,
format
:
"esm"
,
bundle
:
true
,
external
,
plugins
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
//
@todo
Remove in next major release.
const
globalName
=
pkg
.
name
.
replace
(
/
-
/
g
,
""
)
.
toUpperCase
(
)
;
const
requireShim
=
`if(typeof window==="object"&&!window.require)window.require=()=>window.THREE;`
;
const
footer
=
`if(typeof module==="object"&&module.exports)module.exports=
${
globalName
}
;`
;
await
esbuild
.
build
(
{
entryPoints
:
[
"src/index.js"
]
,
outfile
:
`build/
${
pkg
.
name
}
.js`
,
banner
:
{
js
:
`
${
banner
}
\n
${
requireShim
}
`
}
,
footer
:
{
js
:
footer
}
,
logLevel
:
"info"
,
format
:
"iife"
,
bundle
:
true
,
globalName
,
external
,
plugins
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
await
esbuild
.
build
(
{
entryPoints
:
[
"src/index.js"
]
,
outfile
:
`build/
${
pkg
.
name
}
.min.js`
,
banner
:
{
js
:
`
${
banner
}
\n
${
requireShim
}
`
}
,
footer
:
{
js
:
footer
}
,
logLevel
:
"info"
,
format
:
"iife"
,
bundle
:
true
,
globalName
,
external
,
plugins
,
minify
}
)
.
catch
(
(
)
=>
process
.
exit
(
1
)
)
;
Back
|
FazBrowse Home
|
New Git URL