Skip to content

Commit

Permalink
feat: disable glsl compress for non mini package
Browse files Browse the repository at this point in the history
  • Loading branch information
Sway007 committed Dec 18, 2024
1 parent 24abef3 commit e348595
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ pkgs.push({ ...shaderLabPkg, verboseMode: true });
const extensions = [".js", ".jsx", ".ts", ".tsx"];
const mainFields = NODE_ENV === "development" ? ["debug", "module", "main"] : undefined;

const glslifyPlugin = glslify({
include: [/\.(glsl|gs)$/],
compress: false
});

const commonPlugins = [
resolve({ extensions, preferBuiltins: true, mainFields }),
glslify({
include: [/\.(glsl|gs)$/]
}),
glslifyPlugin,
swc(
defineRollupSwcOption({
include: /\.[mc]?[jt]sx?$/,
Expand Down Expand Up @@ -90,6 +93,15 @@ function config({ location, pkgJson, verboseMode }) {
}
} else {
if (compress) {
const glslifyPluginIdx = curPlugins.findIndex((item) => item === glslifyPlugin);
curPlugins.splice(
glslifyPluginIdx,
1,
glslify({
include: [/\.(glsl|gs)$/],
compress: true
})
);
curPlugins.push(minify({ sourceMap: true }));
file = path.join(location, "dist", "browser.min.js");
} else {
Expand Down

0 comments on commit e348595

Please sign in to comment.