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

Fix module export and update renderer to 1.3.6 #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions build/build-browser.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const process = require("process");
const dev = process.argv.includes("--dev");
const watch = process.argv.find(arg => arg === "-w" || arg === "--watch") !== undefined;
const fs = require("fs");

require("esbuild").build({
entryPoints: [
"./src/index.ts"
"./src/browser.ts"
],
bundle: true,
loader: {
Expand All @@ -18,4 +19,8 @@ require("esbuild").build({
outdir: "./bundle",
publicPath: "bundle",
globalName: "RaindropFX",
})
}).then((result) =>
{
fs.renameSync("./bundle/browser.js", "./bundle/index.js");
fs.renameSync("./bundle/browser.js.map", "./bundle/index.js.map");
});
23 changes: 20 additions & 3 deletions build/build-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,24 @@ require("esbuild").build({
minify: !dev,
watch: watch,
sourcemap: true,
outdir: "./dist",
platform: "browser",
outfile: "./dist/index.js",
platform: "node",
format: "cjs",
})
});
require("esbuild").build({
entryPoints: [
"./src/index.ts"
],
bundle: true,
loader: {
".png": "binary",
".jpg": "binary",
".glsl": "text",
},
minify: !dev,
watch: watch,
sourcemap: true,
outfile: "./dist/index.mjs",
platform: "node",
format: "esm",
});
24 changes: 12 additions & 12 deletions bundle/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions bundle/index.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/browser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import RaindropFX from "./index";
export = RaindropFX;
//# sourceMappingURL=browser.d.ts.map
1 change: 1 addition & 0 deletions dist/browser.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ declare class RaindropFX {
destroy(): void;
private update;
}
export = RaindropFX;
export default RaindropFX;
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10,112 changes: 9,811 additions & 301 deletions dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.js.map

Large diffs are not rendered by default.

Loading