Skip to content

Commit

Permalink
build: init an esbuild script
Browse files Browse the repository at this point in the history
  • Loading branch information
radiovisual committed May 31, 2024
1 parent 72e2dca commit 596eb6c
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 49 deletions.
11 changes: 11 additions & 0 deletions build/cli.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as esbuild from 'esbuild';

await esbuild.build({
entryPoints: ['./src/**/*.mts'],
bundle: true,
outdir: 'dist',
platform: 'node',
legalComments: 'inline',
packages: 'external',
target: 'node16'
});
51 changes: 25 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
{
"name": "i18n-validator",
"version": "1.0.0",
"main": "dist/index.js",
"scripts": {
"build:prod": "rm -rf dist/* && tsc -noEmit && esbuild src/index.mts --legal-comments=external --platform=node --bundle --outdir=dist --packages=external --minify --sourcemap",
"build:dev": "rm -rf dist/* && npm run typecheck && esbuild src/index.mts --platform=node --bundle --outdir=dist --packages=external",
"start": "npm run build:dev -- --watch",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"bin": {
"i18n-validate": "dist/index.js"
},
"type": "module",
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.12.13",
"esbuild": "0.21.4",
"jest": "^29.7.0",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"dependencies": {
"chalk": "^4.0.0"
}
"name": "i18n-validator",
"version": "1.0.0",
"main": "dist/index.js",
"scripts": {
"build:prod": "rm -rf dist/* && node build/cli.mjs",
"build:dev": "rm -rf dist/* && npm run typecheck && tsc && node build/cli.mjs",
"start": "npm run build:dev -- --watch",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"bin": {
"i18n-validate": "dist/index.js"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^20.12.13",
"esbuild": "0.21.4",
"jest": "^29.7.0",
"ts-jest": "^29.1.4",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"dependencies": {
"chalk": "^4.0.0"
}
}
46 changes: 23 additions & 23 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"esModuleInterop": true,
"moduleResolution": "NodeNext",
"rootDir": "./src",
"outDir": "./dist",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true
},
"include": [
"src/**/*.ts",
"src/**/*.mts",
"src/rules/no-untranslated-messages/no-untranslated-messages.mts",
"src/rules/no-untranslated-messages/index.mts",
"src/index.mts",
"src/config/default-config.mts",
"src/types.mts"
],
"exclude": ["node_modules", "dist"]
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"esModuleInterop": true,
"moduleResolution": "NodeNext",
"rootDir": "./src",
"outDir": "./dist",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true
},
"include": [
"src/**/*.ts",
"src/**/*.mts",
"src/rules/no-untranslated-messages/no-untranslated-messages.mts",
"src/rules/no-untranslated-messages/index.mts",
"src/index.mts",
"src/config/default-config.mts",
"src/types.mts"
],
"exclude": ["node_modules", "dist"]
}

0 comments on commit 596eb6c

Please sign in to comment.