mrseanryan / tslint-folders

:file_folder: Use tslint to check for invalid imports between packages and folders in your TypeScript project. Automatic validation and documentation of package architecture.
MIT License
9 stars 1 forks source link

Try add bundling via fuse-box #11

Open mrseanryan opened 4 years ago

mrseanryan commented 4 years ago

fuse-box configured for server target.

ref: https://fuse-box.org/docs/getting-started/setup#start-with-server

mrseanryan commented 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
mrseanryan commented 4 years ago

example: https://gist.github.com/pedronauck/25a6c6f0bf4d9237485756071bc81420