From 6617b7ca476c3f4a8a1a04978bdda33b16341b6d Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 22 Sep 2020 08:05:03 +0100 Subject: [PATCH] Rollup: Replace addons three.module.js dependency. --- utils/build/rollup.config.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/utils/build/rollup.config.js b/utils/build/rollup.config.js index b409c196adcf30..b79eb8be9768c4 100644 --- a/utils/build/rollup.config.js +++ b/utils/build/rollup.config.js @@ -170,6 +170,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 { @@ -259,6 +280,7 @@ export default [ { input: 'src/Three.js', plugins: [ + addons(), glconstants(), glsl(), buble( { @@ -282,6 +304,7 @@ export default [ { input: 'src/Three.js', plugins: [ + addons(), glconstants(), glsl(), buble( { @@ -306,6 +329,7 @@ export default [ { input: 'src/Three.js', plugins: [ + addons(), glconstants(), glsl(), header()