Switched from tsc to esbuild for building
This commit is contained in:
parent
ccdcce0885
commit
cbf4e91519
15
esbuild.config.js
Normal file
15
esbuild.config.js
Normal file
@ -0,0 +1,15 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const esbuild = require('esbuild');
|
||||
|
||||
esbuild
|
||||
.build({
|
||||
entryPoints: ['./src/index.ts'],
|
||||
outdir: 'lib',
|
||||
bundle: true,
|
||||
minify: true,
|
||||
platform: 'browser',
|
||||
sourcemap: true,
|
||||
format: 'esm',
|
||||
target: ['esnext'],
|
||||
})
|
||||
.catch(() => process.exit(1));
|
13
package.json
13
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "html-pagination",
|
||||
"version": "1.0.0",
|
||||
"version": "0.0.0",
|
||||
"description": "Package for html document pagination to fit container with fixed width",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@ -8,8 +8,9 @@
|
||||
"./lib/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"test:browser": "npm run build -- --module 'esnext' && cp ./src/__tests__/index.html ./lib/ && bash -c 'for module in \".\\/cache\" \".\\/types\" \".\\/utils\"; do sed -i \"s/$module/$module.js/g\" ./lib/index.js; done' && serve -s lib",
|
||||
"build": "rm -rf lib && tsc",
|
||||
"test:browser": "npm run build && cp ./src/__tests__/index.html ./lib/ && serve -s lib",
|
||||
"build": "node esbuild.config.js && npm run type-check",
|
||||
"type-check": "tsc --emitDeclarationOnly --outDir lib",
|
||||
"lint": "eslint .",
|
||||
"format": "prettier --write .",
|
||||
"test": "jest --config jestconfig.json --passWithNoTests",
|
||||
@ -40,10 +41,10 @@
|
||||
"esbuild": "^0.12.17",
|
||||
"esbuild-jest": "^0.5.0",
|
||||
"eslint": "^7.32.0",
|
||||
"jest": "^27.0.6",
|
||||
"typescript": "^4.3.5",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"prettier": "^2.3.2"
|
||||
"jest": "^27.0.6",
|
||||
"prettier": "^2.3.2",
|
||||
"typescript": "^4.3.5"
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"outDir": "./lib",
|
||||
"strict": true
|
||||
"strict": true,
|
||||
"emitDeclarationOnly": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": ["node_modules", "**/__tests__/*"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user