|
@@ -1,29 +1,6 @@
|
|
import terser from '@rollup/plugin-terser';
|
|
import terser from '@rollup/plugin-terser';
|
|
import MagicString from 'magic-string';
|
|
import MagicString from 'magic-string';
|
|
|
|
|
|
-function addons() {
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
-
|
|
|
|
- transform( code, id ) {
|
|
|
|
-
|
|
|
|
- if ( /\/examples\/jsm\//.test( id ) === false ) return;
|
|
|
|
-
|
|
|
|
- code = new MagicString( code );
|
|
|
|
-
|
|
|
|
- code.replace( 'build/three.module.js', 'src/Three.js' );
|
|
|
|
-
|
|
|
|
- return {
|
|
|
|
- code: code.toString(),
|
|
|
|
- map: code.generateMap().toString()
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
export function glsl() {
|
|
export function glsl() {
|
|
|
|
|
|
return {
|
|
return {
|
|
@@ -49,7 +26,7 @@ export function glsl() {
|
|
|
|
|
|
return {
|
|
return {
|
|
code: code.toString(),
|
|
code: code.toString(),
|
|
- map: code.generateMap().toString()
|
|
|
|
|
|
+ map: code.generateMap()
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
@@ -74,7 +51,7 @@ function header() {
|
|
|
|
|
|
return {
|
|
return {
|
|
code: code.toString(),
|
|
code: code.toString(),
|
|
- map: code.generateMap().toString()
|
|
|
|
|
|
+ map: code.generateMap()
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
@@ -95,7 +72,7 @@ function deprecationWarning() {
|
|
|
|
|
|
return {
|
|
return {
|
|
code: code.toString(),
|
|
code: code.toString(),
|
|
- map: code.generateMap().toString()
|
|
|
|
|
|
+ map: code.generateMap()
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
@@ -108,7 +85,6 @@ const builds = [
|
|
{
|
|
{
|
|
input: 'src/Three.js',
|
|
input: 'src/Three.js',
|
|
plugins: [
|
|
plugins: [
|
|
- addons(),
|
|
|
|
glsl(),
|
|
glsl(),
|
|
header()
|
|
header()
|
|
],
|
|
],
|
|
@@ -122,7 +98,6 @@ const builds = [
|
|
{
|
|
{
|
|
input: 'src/Three.js',
|
|
input: 'src/Three.js',
|
|
plugins: [
|
|
plugins: [
|
|
- addons(),
|
|
|
|
glsl(),
|
|
glsl(),
|
|
header(),
|
|
header(),
|
|
terser()
|
|
terser()
|
|
@@ -137,7 +112,6 @@ const builds = [
|
|
{
|
|
{
|
|
input: 'src/Three.js',
|
|
input: 'src/Three.js',
|
|
plugins: [
|
|
plugins: [
|
|
- addons(),
|
|
|
|
glsl(),
|
|
glsl(),
|
|
header()
|
|
header()
|
|
],
|
|
],
|
|
@@ -154,7 +128,6 @@ const builds = [
|
|
{ // @deprecated, r150
|
|
{ // @deprecated, r150
|
|
input: 'src/Three.js',
|
|
input: 'src/Three.js',
|
|
plugins: [
|
|
plugins: [
|
|
- addons(),
|
|
|
|
glsl(),
|
|
glsl(),
|
|
header(),
|
|
header(),
|
|
deprecationWarning()
|
|
deprecationWarning()
|
|
@@ -171,7 +144,6 @@ const builds = [
|
|
{ // @deprecated, r150
|
|
{ // @deprecated, r150
|
|
input: 'src/Three.js',
|
|
input: 'src/Three.js',
|
|
plugins: [
|
|
plugins: [
|
|
- addons(),
|
|
|
|
glsl(),
|
|
glsl(),
|
|
header(),
|
|
header(),
|
|
deprecationWarning(),
|
|
deprecationWarning(),
|