@lwrjs/tools 0.9.0-alpha.18 → 0.9.0-alpha.20

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.
@@ -1,6 +1,7 @@
1
1
  import type { LwrGlobalConfig } from '@lwrjs/types';
2
2
  export interface BuildOptions {
3
3
  outputDir?: string;
4
+ minify?: boolean;
4
5
  }
5
6
  /**
6
7
  * Resolve configurations, generate a server build module, and bundle
@@ -6,14 +6,14 @@ import { getFeatureFlags, logger } from '@lwrjs/shared-utils';
6
6
  import { LWR_VERSION } from '@lwrjs/config';
7
7
  import generateLwrEntry from './plugins/generate-entry-plugin.js';
8
8
  import buildLwrServer from './plugins/build-server-plugin.js';
9
- async function build(outputDir, config) {
9
+ async function build(buildOptions, config) {
10
+ const { outputDir, minify } = buildOptions;
10
11
  // building specifically for MRT/Lambda
11
12
  await esbuild.build({
12
13
  entryPoints: ['./lwr.entry.js'],
13
14
  bundle: true,
14
- // TODO default to minify and no source map. Enable a debug build mode to set these up
15
- minify: true,
16
- sourcemap: true,
15
+ minify,
16
+ sourcemap: !!minify,
17
17
  format: 'cjs',
18
18
  platform: 'node',
19
19
  logLevel: 'silent',
@@ -56,7 +56,7 @@ export async function buildServer(configArg, options) {
56
56
  const startTime = performance.now();
57
57
  const outputDir = path.join(configArg?.rootDir || process.cwd(), options?.outputDir || '/build');
58
58
  await fs.ensureDir(outputDir);
59
- await build(outputDir, configArg);
59
+ await build({ outputDir, minify: !!options?.minify }, configArg);
60
60
  const endTime = performance.now();
61
61
  const timeDiff = endTime - startTime;
62
62
  logger.info(`[Server Build] successfully built the server in ${Math.round(timeDiff)} ms`);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.9.0-alpha.18",
7
+ "version": "0.9.0-alpha.20",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -32,11 +32,11 @@
32
32
  "package.cjs"
33
33
  ],
34
34
  "dependencies": {
35
- "@lwrjs/core": "0.9.0-alpha.18",
35
+ "@lwrjs/core": "0.9.0-alpha.20",
36
36
  "esbuild": "^0.17.4"
37
37
  },
38
38
  "devDependencies": {
39
- "@lwrjs/types": "0.9.0-alpha.18"
39
+ "@lwrjs/types": "0.9.0-alpha.20"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "lwc": "2.x"
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=14.15.4 <19"
46
46
  },
47
- "gitHead": "0d612ec0c74c679ce422f7bbae9fae14134f7d9f"
47
+ "gitHead": "b01b6beb86cae6c28308c373db15cb1a4f42a0ee"
48
48
  }