Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jul 6, 2022
1 parent 8b6c097 commit 4390cea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
],
"scripts": {
"check": "tsc --noEmit",
"preprepare": "esrun ./scripts/generate-exports-file.ts",
"prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"devDependencies": {
Expand Down Expand Up @@ -97,6 +96,7 @@
"access": "public"
},
"bundler": {
"pre": "./scripts/generate-exports-file.ts",
"entries": [
"./src/index.tsx",
"./src/globals.ts",
Expand Down
2 changes: 0 additions & 2 deletions scripts/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function run() {
option: '--prep',
command: () => {
log.info(prefix, 'prepare');
spawn(`nx run-many --target="preprepare" --all --parallel`);
spawn(`nx run-many --target="prepare" --all --parallel -- --reset`);
},
order: 2,
Expand Down Expand Up @@ -120,7 +119,6 @@ function run() {
option: '--build',
command: () => {
log.info(prefix, 'build');
spawn(`nx run-many --target="preprepare" --all --parallel`);
spawn(
`nx run-many --target="prepare" --all --parallel=8 ${
process.env.CI ? `--max-parallel=${maxConcurrentTasks}` : ''
Expand Down
7 changes: 6 additions & 1 deletion scripts/prepare/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import fs from 'fs-extra';
import path, { join } from 'path';
import { build } from 'tsup';
import aliasPlugin from 'esbuild-plugin-alias';
import shelljs from 'shelljs';

const hasFlag = (flags: string[], name: string) => !!flags.find((s) => s.startsWith(`--${name}`));

Expand All @@ -10,9 +11,13 @@ const run = async ({ cwd, flags }: { cwd: string; flags: string[] }) => {
name,
dependencies,
peerDependencies,
bundler: { entries, platform },
bundler: { entries, platform, pre },
} = await fs.readJson(join(cwd, 'package.json'));

if (pre) {
shelljs.exec(`esrun ${pre}`, { cwd });
}

const reset = hasFlag(flags, 'reset');
const watch = hasFlag(flags, 'watch');
const optimized = hasFlag(flags, 'optimized');
Expand Down

0 comments on commit 4390cea

Please sign in to comment.