Skip to content

Commit

Permalink
minimize output size by importing directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli committed Sep 7, 2022
1 parent 789ecc1 commit f6ade3e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions apps/nxls/esbuild.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
require('esbuild')
.build({
(async () => {
let esbuild = require('esbuild');

let result = await esbuild.build({
entryPoints: ['./apps/nxls/src/main.ts'],
bundle: true,
minify: true,
platform: 'node',
mainFields: ['module', 'main'],
outfile: './dist/apps/vscode/nxls/main.js',
})
.catch(() => process.exit(1));
metafile: true,
});

let text = await esbuild.analyzeMetafile(result.metafile, {
verbose: true,
});

// Comment out to analyze the build
// await require('fs/promises').writeFile('./dep.txt', text);
})();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseTargetString } from '@nrwl/devkit';
import { parseTargetString } from '@nrwl/devkit/src/executors/parse-target-string';
import { fileExists, readFile } from '@nx-console/file-system';
import {
findProperty,
Expand Down
2 changes: 1 addition & 1 deletion libs/schema/src/normalize-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
XPrompt,
} from './index';
import { Schema } from 'nx/src/utils/params';
import { names } from '@nrwl/devkit';
import { names } from '@nrwl/devkit/src/utils/names';

export interface GeneratorDefaults {
[name: string]: string;
Expand Down

0 comments on commit f6ade3e

Please sign in to comment.