close to final version added the subtaskand comment working section

This commit is contained in:
tusuii
2026-02-16 19:50:23 +05:30
parent 6aec1445e9
commit 1788e364f1
28 changed files with 5867 additions and 133 deletions

42
temp_spin/temp/build.mjs Normal file
View File

@@ -0,0 +1,42 @@
// build.mjs
import { build } from 'esbuild';
import path from 'path';
import { SpinEsbuildPlugin } from "@spinframework/build-tools/plugins/esbuild/index.js";
import fs from 'fs';
const spinPlugin = await SpinEsbuildPlugin();
// plugin to handle vendor files in node_modules that may not be bundled.
// Instead of generating a real source map for these files, it appends a minimal
// inline source map pointing to an empty source. This avoids errors and ensures
// source maps exist even for unbundled vendor code.
let SourceMapPlugin = {
name: 'excludeVendorFromSourceMap',
setup(build) {
build.onLoad({ filter: /node_modules/ }, args => {
return {
contents: fs.readFileSync(args.path, 'utf8')
+ '\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIiJdLCJtYXBwaW5ncyI6IkEifQ==',
loader: 'default',
}
})
},
}
await build({
entryPoints: ['./src/index.js'],
outfile: './build/bundle.js',
bundle: true,
format: 'esm',
platform: 'node',
sourcemap: true,
minify: false,
plugins: [spinPlugin, SourceMapPlugin],
logLevel: 'error',
loader: {
'.ts': 'ts',
'.tsx': 'tsx',
},
resolveExtensions: ['.ts', '.tsx', '.js'],
sourceRoot: path.resolve(process.cwd(), 'src'),
});