Skip to content

Commit

Permalink
dynamic register ts node loader (#27587)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Oct 16, 2024
1 parent 5be5129 commit e8707b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 152 deletions.
6 changes: 0 additions & 6 deletions bin/cli.cjs

This file was deleted.

11 changes: 6 additions & 5 deletions bin/jhipster.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
// Executable file that runs jhipster sources in JIT mode.
// This file should be used for development purposes and should not be distributed in the npm package.
// Executable should be written in commonjs https://github.com/nodejs/modules/issues/152.
const { join } = require('path');
const { Module } = require('module');
const { pathToFileURL } = require('url');

const [_nodeExec, _exec, ...args] = process.argv;
// eslint-disable-next-line no-console
console.error('jhipster', ...args);

(async () => {
const { default: esbuildx } = await import('@node-loaders/esbuildx');
await esbuildx(join(__dirname, 'cli.cjs'));
})();
process.env.JHIPSTER_DEV_BLUEPRINT = true;
Module.register(pathToFileURL(require.resolve('@node-loaders/esbuild/strict')).href);

require('../cli/jhipster.cjs');
141 changes: 1 addition & 140 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
"devDependencies": {
"@actions/core": "1.11.1",
"@eslint/core": "0.6.0",
"@node-loaders/esbuildx": "1.4.0",
"@node-loaders/esbuild": "1.1.0",
"@types/chai": "4.3.16",
"@types/estree": "1.0.6",
"@types/node": "20.11.25",
Expand Down

0 comments on commit e8707b3

Please sign in to comment.