Skip to content

Commit

Permalink
refactor: normalize vite configs, use tsx for store/world scripts (#655)
Browse files Browse the repository at this point in the history
* refactor: normalize vite configs

* refactor(store,world): use tsx for scripts rather than building them
  • Loading branch information
dk1a authored Apr 20, 2023
1 parent f5edd0e commit 9f51646
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/cli/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default defineConfig({
formats: ["es"],
},
outDir: "dist",
minify: false,
minify: true,
sourcemap: true,
target: "esnext",
},
Expand Down
5 changes: 3 additions & 2 deletions packages/common/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ export default defineConfig({
formats: ["es"],
},
outDir: "dist",
minify: false,
minify: true,
sourcemap: true,
target: "esnext",
},
ssr: {
noExternal: ["execa", "is-stream", "npm-run-path"],
noExternal: ["execa", "is-stream", "npm-run-path", "@latticexyz/solidity-parser"],
},
/**
* @see https://vitest.dev/config/
Expand Down
3 changes: 2 additions & 1 deletion packages/config/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ export default defineConfig({
formats: ["es"],
},
outDir: "dist",
minify: false,
minify: true,
sourcemap: true,
target: "esnext",
},
/**
* @see https://vitest.dev/config/
Expand Down
4 changes: 2 additions & 2 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"types": "ts/index.ts",
"scripts": {
"build": "pnpm run build:js && pnpm run build:tightcoder && pnpm run build:codegen && pnpm run build:abi && pnpm run build:typechain",
"build": "pnpm run build:tightcoder && pnpm run build:codegen && pnpm run build:abi && pnpm run build:typechain && pnpm run build:js",
"build:abi": "forge build --out abi --skip test script",
"build:codegen": "node ./dist/tablegen.js",
"build:codegen": "tsx ./ts/scripts/tablegen.ts",
"build:js": "vite build",
"build:tightcoder": "tsx ./ts/scripts/codegenTightcoder.ts && prettier --write '**/*.sol'",
"build:typechain": "typechain --target ethers-v5 'abi/**/*.sol/!(*.abi).json'",
Expand Down
4 changes: 2 additions & 2 deletions packages/store/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export default defineConfig({
build: {
ssr: true,
lib: {
entry: ["mud.config.ts", "ts/scripts/tablegen.ts", "ts/index.ts"],
entry: ["mud.config.ts", "ts/index.ts"],
formats: ["es"],
},
outDir: "dist",
minify: false,
minify: true,
sourcemap: true,
target: "esnext",
},
Expand Down
4 changes: 2 additions & 2 deletions packages/world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
},
"types": "ts/index.ts",
"scripts": {
"build": "pnpm run build:js && pnpm run build:codegen && pnpm run build:abi && pnpm run build:typechain",
"build": "pnpm run build:codegen && pnpm run build:abi && pnpm run build:typechain && pnpm run build:js",
"build:abi": "forge build --out abi --skip test script",
"build:codegen": "node ./dist/tablegen.js && node ./dist/worldgen.js",
"build:codegen": "tsx ./ts/scripts/tablegen.ts && tsx ./ts/scripts/worldgen.ts",
"build:js": "vite build",
"build:typechain": "typechain --target ethers-v5 'abi/**/*.sol/!(*.abi).json'",
"clean": "pnpm run clean:abi && pnpm run clean:typechain && pnpm run clean:js",
Expand Down
4 changes: 2 additions & 2 deletions packages/world/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export default defineConfig({
build: {
ssr: true,
lib: {
entry: ["ts/scripts/worldgen.ts", "ts/scripts/tablegen.ts", "ts/index.ts", "mud.config.ts"],
entry: ["ts/index.ts", "mud.config.ts"],
formats: ["es"],
},
outDir: "dist",
minify: false,
minify: true,
sourcemap: true,
target: "esnext",
},
Expand Down

1 comment on commit 9f51646

@vercel
Copy link

@vercel vercel bot commented on 9f51646 Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.