Skip to content

Commit 72099c6

Browse files
committed
build to cjs
1 parent f82c5b0 commit 72099c6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

template/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "My Moleculer-based microservices project",
55
"type": "commonjs",
66
"scripts": {
7-
"build": "tsc --project tsconfig.build.json",
7+
"build": "tsc --project tsconfig.build.json || cd .",
8+
"postbuild": "echo {\"type\": \"commonjs\"} > dist/package.json",
89
"dev": "tsx ./node_modules/moleculer/bin/moleculer-runner.js --config moleculer.config.ts --hot --repl services/**/*.service.ts",
910
"start": "moleculer-runner --config dist/moleculer.config.js",
1011
"cli": "moleculer connect {{transporter}}",

template/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
1212

1313
/* Language and Environment */
14-
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
14+
"target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
1515
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
1616
// "jsx": "preserve", /* Specify what JSX code is generated. */
1717
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
@@ -25,9 +25,9 @@
2525
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
2626

2727
/* Modules */
28-
"module": "node16", /* Specify what module code is generated. */
28+
"module": "nodenext", /* Specify what module code is generated. */
2929
// "rootDir": "./", /* Specify the root folder within your source files. */
30-
"moduleResolution": "node16", /* Specify how TypeScript looks up a file from a given module specifier. */
30+
"moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */
3131
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
3232
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3333
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */

0 commit comments

Comments
 (0)