Merge pull request #242 from oke-py/feature/migrate-to-rollup
chore: migrate build process from @vercel/ncc to rollup
This commit is contained in:
1505
package-lock.json
generated
1505
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -5,18 +5,20 @@
|
|||||||
"description": "GitHub Action to run `npm audit`",
|
"description": "GitHub Action to run `npm audit`",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
".": "./dist/index.js"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc",
|
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint src/**/*.ts",
|
||||||
"pack": "ncc build --v8-cache --source-map --target es2020",
|
"pack": "npx rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
|
||||||
"test": "vitest --run",
|
"test": "vitest --run",
|
||||||
"test:coverage": "vitest --run --coverage",
|
"test:coverage": "vitest --run --coverage",
|
||||||
"all": "npm run build && npm run format && npm run lint && npm run pack && npm run test:coverage"
|
"all": "npm run format && npm run lint && npm run test:coverage && npm run pack"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -37,10 +39,12 @@
|
|||||||
"strip-ansi": "^7.1.0"
|
"strip-ansi": "^7.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-commonjs": "^25.0.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
||||||
|
"@rollup/plugin-typescript": "^11.0.0",
|
||||||
"@types/node": "^20.0.0",
|
"@types/node": "^20.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
||||||
"@typescript-eslint/parser": "^8.31.1",
|
"@typescript-eslint/parser": "^8.31.1",
|
||||||
"@vercel/ncc": "^0.38.3",
|
|
||||||
"@vitest/coverage-v8": "^3.1.2",
|
"@vitest/coverage-v8": "^3.1.2",
|
||||||
"eslint": "^9.26.0",
|
"eslint": "^9.26.0",
|
||||||
"eslint-define-config": "^2.1.0",
|
"eslint-define-config": "^2.1.0",
|
||||||
@@ -48,6 +52,8 @@
|
|||||||
"eslint-plugin-github": "^6.0.0",
|
"eslint-plugin-github": "^6.0.0",
|
||||||
"js-yaml": "^4.0.0",
|
"js-yaml": "^4.0.0",
|
||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
|
"rollup": "^3.0.0",
|
||||||
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"vite": "^6.3.4",
|
"vite": "^6.3.4",
|
||||||
"vitest": "^3.1.2"
|
"vitest": "^3.1.2"
|
||||||
|
|||||||
19
rollup.config.ts
Normal file
19
rollup.config.ts
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import typescript from '@rollup/plugin-typescript';
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
input: 'src/main.ts',
|
||||||
|
output: {
|
||||||
|
file: 'dist/index.js',
|
||||||
|
format: 'cjs',
|
||||||
|
sourcemap: true
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
typescript()
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
15
tsconfig.eslint.json
Normal file
15
tsconfig.eslint.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"noEmit": true
|
||||||
|
},
|
||||||
|
"exclude": ["dist", "node_modules"],
|
||||||
|
"include": [
|
||||||
|
"__tests__",
|
||||||
|
"src",
|
||||||
|
"eslint.config.js",
|
||||||
|
"rollup.config.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user