@nx/esbuild 19.6.0 → 19.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # Nx: Smart Monorepos · Fast CI
24
24
 
25
- Nx is a build system with built-in tooling and advanced CI capabilities. It helps you maintain and scale monorepos, both locally and on CI.
25
+ Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
26
26
 
27
27
  This package is a [EsBuild plugin for Nx](https://nx.dev/nx-api/esbuild).
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/esbuild",
3
- "version": "19.6.0",
3
+ "version": "19.6.2",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for esbuild contains executors and generators that support building applications using esbuild",
6
6
  "repository": {
@@ -36,9 +36,9 @@
36
36
  "fs-extra": "^11.1.0",
37
37
  "tslib": "^2.3.0",
38
38
  "tsconfig-paths": "^4.1.2",
39
- "@nx/devkit": "19.6.0",
40
- "@nx/js": "19.6.0",
41
- "@nrwl/esbuild": "19.6.0"
39
+ "@nx/devkit": "19.6.2",
40
+ "@nx/js": "19.6.2",
41
+ "@nrwl/esbuild": "19.6.2"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "esbuild": "~0.19.2"
@@ -29,6 +29,7 @@ async function* esbuildExecutor(_options, context) {
29
29
  });
30
30
  }
31
31
  return acc;
32
+ return acc;
32
33
  }, []);
33
34
  if (!options.thirdParty) {
34
35
  const thirdPartyDependencies = (0, get_extra_dependencies_1.getExtraDependencies)(context.projectName, context.projectGraph);
@@ -143,6 +144,7 @@ async function* esbuildExecutor(_options, context) {
143
144
  }
144
145
  function getTypeCheckOptions(options, context) {
145
146
  const { watch, tsConfig, outputPath } = options;
147
+ const projectRoot = context.projectGraph.nodes[context.projectName].data.root;
146
148
  const typeCheckOptions = {
147
149
  ...(options.declaration
148
150
  ? {
@@ -152,9 +154,10 @@ function getTypeCheckOptions(options, context) {
152
154
  : {
153
155
  mode: 'noEmit',
154
156
  }),
155
- tsConfigPath: tsConfig,
157
+ tsConfigPath: (0, path_1.relative)(process.cwd(), (0, path_1.join)(context.root, tsConfig)),
156
158
  workspaceRoot: context.root,
157
159
  rootDir: options.declarationRootDir ?? context.root,
160
+ projectRoot,
158
161
  };
159
162
  if (watch) {
160
163
  typeCheckOptions.incremental = true;
@@ -9,6 +9,7 @@ const fs_1 = require("fs");
9
9
  const devkit_1 = require("@nx/devkit");
10
10
  const environment_variables_1 = require("../../../utils/environment-variables");
11
11
  const get_entry_points_1 = require("../../../utils/get-entry-points");
12
+ const path_1 = require("path");
12
13
  const ESM_FILE_EXTENSION = '.js';
13
14
  const CJS_FILE_EXTENSION = '.cjs';
14
15
  function buildEsbuildOptions(format, options, context) {
@@ -28,7 +29,7 @@ function buildEsbuildOptions(format, options, context) {
28
29
  platform: options.platform,
29
30
  target: options.target,
30
31
  metafile: options.metafile,
31
- tsconfig: options.tsConfig,
32
+ tsconfig: (0, path_1.relative)(process.cwd(), (0, path_1.join)(context.root, options.tsConfig)),
32
33
  sourcemap: (options.sourcemap ?? options.userDefinedBuildOptions?.sourcemap) ||
33
34
  false,
34
35
  format,
@@ -37,7 +38,10 @@ function buildEsbuildOptions(format, options, context) {
37
38
  },
38
39
  };
39
40
  if (options.platform === 'browser') {
40
- esbuildOptions.define = (0, environment_variables_1.getClientEnvironment)();
41
+ esbuildOptions.define = {
42
+ ...(0, environment_variables_1.getClientEnvironment)(),
43
+ ...options.userDefinedBuildOptions?.define,
44
+ };
41
45
  }
42
46
  if (!esbuildOptions.outfile && !esbuildOptions.outdir) {
43
47
  if (options.singleEntry && options.bundle && !esbuildOptions.splitting) {