Skip to content

Commit f93563c

Browse files
authored
Merge pull request #20389 from mrdoob/rollup
Rollup: Replace addons three.module.js dependency.
2 parents 87ab679 + 6617b7c commit f93563c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

utils/build/rollup.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,27 @@ function glconstants() {
180180

181181
}
182182

183+
function addons() {
184+
185+
return {
186+
187+
transform( code, id ) {
188+
189+
if ( /\/examples\/jsm\//.test( id ) === false ) return;
190+
191+
code = code.replace( 'build/three.module.js', 'src/Three.js' );
192+
193+
return {
194+
code: code,
195+
map: null
196+
};
197+
198+
}
199+
200+
};
201+
202+
}
203+
183204
function glsl() {
184205

185206
return {
@@ -306,6 +327,7 @@ export default [
306327
{
307328
input: 'src/Three.js',
308329
plugins: [
330+
addons(),
309331
glconstants(),
310332
glsl(),
311333
babel( {
@@ -329,6 +351,7 @@ export default [
329351
{
330352
input: 'src/Three.js',
331353
plugins: [
354+
addons(),
332355
glconstants(),
333356
glsl(),
334357
babel( {
@@ -351,6 +374,7 @@ export default [
351374
{
352375
input: 'src/Three.js',
353376
plugins: [
377+
addons(),
354378
glconstants(),
355379
glsl(),
356380
header()

0 commit comments

Comments
 (0)