1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 02:44:45 +00:00

feat(packages/stdlib): change build system to unbuild

This commit is contained in:
2024-04-19 02:29:27 +07:00
parent 26a99b7d67
commit 531e1721bb
6 changed files with 1630 additions and 407 deletions

View File

@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';
export default defineBuildConfig({
rollup: {
emitCJS: true,
esbuild: {
minify: true,
},
},
});

View File

@@ -26,29 +26,28 @@
"files": [
"dist"
],
"main": "./dist/stdlib.umd.js",
"module": "./dist/stdlib.js",
"types": "./dist/stdlib.d.ts",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/stdlib.js",
"require": "./dist/stdlib.umd.js",
"types": "./dist/stdlib.d.ts"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:bench": "vitest bench",
"dev": "vite build --watch",
"build": "vite build"
"dev": "vitest",
"build": "unbuild"
},
"devDependencies": {
"@robonen/tsconfig": "workspace:*",
"@vitest/coverage-v8": "^1.5.0",
"pathe": "^1.1.2",
"vite": "^5.2.9",
"vite-plugin-dts": "^3.8.3",
"vitest": "^1.5.0"
"vitest": "^1.5.0",
"unbuild": "^2.0.0"
}
}

View File

@@ -1,3 +1,3 @@
{
"extends": "@robonen/tsconfig/tsconfig.json",
"extends": "@robonen/tsconfig/tsconfig.json"
}

View File

@@ -1,24 +0,0 @@
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { resolve } from 'pathe';
export default defineConfig({
build: {
lib: {
name: 'Stdlib',
fileName: 'stdlib',
entry: resolve(__dirname, './src/index.ts'),
},
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
plugins: [
dts({
insertTypesEntry: true,
exclude: '**/*.test.ts',
}),
],
});

View File

@@ -5,6 +5,7 @@
/* Basic Options */
"module": "Preserve",
"noEmit": true,
"lib": ["ESNext"],
"moduleResolution": "Bundler",
"target": "ESNext",
"outDir": "dist",
@@ -26,7 +27,7 @@
/* Library transpiling */
"declaration": true,
"composite": true,
// "composite": true,
"sourceMap": false,
"declarationMap": false
},

1977
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff