Skip to content

Commit

Permalink
Fix rollup for wgsl
Browse files Browse the repository at this point in the history
  • Loading branch information
bbazukun123 committed Dec 29, 2023
1 parent 18849d9 commit 88a08c2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import esbuild from 'rollup-plugin-esbuild';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { string } from 'rollup-plugin-string';
import dedupeDefaultVert from './scripts/rollup-dedupe-vert'
import dedupeDefaultVert from './scripts/rollup-dedupe-vert';
import workspacesRun from 'workspaces-run';

async function main() {
async function main()
{
const plugins = [
esbuild({
target: 'ES2017',
Expand All @@ -17,7 +18,8 @@ async function main() {
string({
include: [
'**/*.frag',
'**/*.vert'
'**/*.vert',
'**/*.wgsl'
]
}),
dedupeDefaultVert()
Expand All @@ -26,7 +28,8 @@ async function main() {
const compiled = (new Date()).toUTCString().replace(/GMT/g, 'UTC');
const sourcemap = true;

const appendPackage = (pkg) => {
const appendPackage = (pkg) =>
{
const banner = [
'/*!',
` * ${pkg.name} - v${pkg.config.version}`,
Expand Down Expand Up @@ -73,9 +76,11 @@ async function main() {
// The package.json file has a bundle field
// we'll use this to generate the bundle file
// this will package all dependencies
if (bundle) {
if (bundle)
{
const name = '__filters';
const footer = `Object.assign(PIXI.filters, ${name});`;

globals = Object.assign({
'@pixi/core': 'PIXI',
'@pixi/filter-alpha': 'PIXI.filters',
Expand Down Expand Up @@ -108,6 +113,7 @@ async function main() {
plugins,
});
}

return builds;
};

Expand Down

0 comments on commit 88a08c2

Please sign in to comment.