Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utils/build/rollup.config.js: Cleanup #26803

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 3 additions & 31 deletions utils/build/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
import terser from '@rollup/plugin-terser';
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() {

return {
Expand All @@ -49,7 +26,7 @@ export function glsl() {

return {
code: code.toString(),
map: code.generateMap().toString()
map: code.generateMap()
};

}
Expand All @@ -74,7 +51,7 @@ function header() {

return {
code: code.toString(),
map: code.generateMap().toString()
map: code.generateMap()
};

}
Expand All @@ -95,7 +72,7 @@ function deprecationWarning() {

return {
code: code.toString(),
map: code.generateMap().toString()
map: code.generateMap()
};

}
Expand All @@ -108,7 +85,6 @@ const builds = [
{
input: 'src/Three.js',
plugins: [
addons(),
glsl(),
header()
],
Expand All @@ -122,7 +98,6 @@ const builds = [
{
input: 'src/Three.js',
plugins: [
addons(),
glsl(),
header(),
terser()
Expand All @@ -137,7 +112,6 @@ const builds = [
{
input: 'src/Three.js',
plugins: [
addons(),
glsl(),
header()
],
Expand All @@ -154,7 +128,6 @@ const builds = [
{ // @deprecated, r150
input: 'src/Three.js',
plugins: [
addons(),
glsl(),
header(),
deprecationWarning()
Expand All @@ -171,7 +144,6 @@ const builds = [
{ // @deprecated, r150
input: 'src/Three.js',
plugins: [
addons(),
glsl(),
header(),
deprecationWarning(),
Expand Down