Open mrseanryan opened 4 years ago
rough notes:
ref: https://fuse-box.org/docs/getting-started/installation
npm install fuse-box typescript terser uglify-js --save-dev
fuse.js
const fuse = FuseBox.init({
homeDir: "src",
target: "server@esnext",
output: "dist/$name.js",
});
fuse
.bundle("app")
.completed(proc => proc.start)
.instructions(" > index.ts")
.hmr()
.watch();
fuse.run();
prod build
xx - learn sparky (task runner)
https://fuse-box.org/docs/task-runner/getting-started-with-sparky
xx - needs Quantum plugin
plugins: [
this.isProduction &&
QuantumPlugin({
uglify: true,
target: "server@esnext",
treeshake: true,
bakeApiIntoBundle: "app", // IS needed, if containedAPI
containedAPI: true, // needed to avoid collision with hosting project? requires 1 bundle in the output and the API is baked into it. ref: https://fuse-box.org/docs/production-builds/quantum-configuration
}),
];
task("dist", async context => {
context.isProduction = true;
const fuse = context.getConfig();
fuse.bundle("app").instructions(">index.ts");
await fuse.run();
});
node fuse dist
fuse-box
configured for server target.ref: https://fuse-box.org/docs/getting-started/setup#start-with-server