Skip to content

Commit

Permalink
Merge pull request #20389 from mrdoob/rollup
Browse files Browse the repository at this point in the history
Rollup: Replace addons three.module.js dependency.
  • Loading branch information
mrdoob authored Sep 23, 2020
2 parents 87ab679 + 6617b7c commit f93563c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions utils/build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,27 @@ function glconstants() {

}

function addons() {

return {

transform( code, id ) {

if ( /\/examples\/jsm\//.test( id ) === false ) return;

code = code.replace( 'build/three.module.js', 'src/Three.js' );

return {
code: code,
map: null
};

}

};

}

function glsl() {

return {
Expand Down Expand Up @@ -306,6 +327,7 @@ export default [
{
input: 'src/Three.js',
plugins: [
addons(),
glconstants(),
glsl(),
babel( {
Expand All @@ -329,6 +351,7 @@ export default [
{
input: 'src/Three.js',
plugins: [
addons(),
glconstants(),
glsl(),
babel( {
Expand All @@ -351,6 +374,7 @@ export default [
{
input: 'src/Three.js',
plugins: [
addons(),
glconstants(),
glsl(),
header()
Expand Down

0 comments on commit f93563c

Please sign in to comment.