Skip to content

Commit

Permalink
build: use unbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-fadaei committed Mar 13, 2022
1 parent 5ed3997 commit 10f1aaf
Show file tree
Hide file tree
Showing 7 changed files with 619 additions and 44 deletions.
15 changes: 15 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { resolve } from 'path';
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
declaration: true,
entries: ['src/index'],
alias: {
'@': resolve(__dirname, './src'),
'~': resolve(__dirname, './playground'),
},
rollup: {
emitCJS: true,
inlineDependencies: true,
},
});
1 change: 0 additions & 1 deletion env.d.ts

This file was deleted.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"scripts": {
"dev": "vite --config ./playground/vite.config.ts",
"deploy": "vite --config ./playground/vite.config.ts build",
"build": "tsc && vite build",
"preview": "vite preview",
"build": "unbuild",
"lint": "eslint --ext .ts,vue --ignore-path .gitignore .",
"test": "vitest --run",
"test:watch": "vitest --watch",
Expand Down Expand Up @@ -41,17 +40,19 @@
"sideEffects": false,
"exports": {
".": {
"import": "./dist/facile-validator.mjs",
"require": "./dist/facile-validator.cjs"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/facile-validator.cjs",
"module": "./dist/facile-validator.mjs",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"src",
"dist"
],
"devDependencies": {
"@babel/types": "7.17.0",
"@types/node": "17.0.17",
"@typescript-eslint/eslint-plugin": "5.14.0",
"@typescript-eslint/parser": "5.14.0",
Expand All @@ -65,6 +66,7 @@
"prettier": "2.5.1",
"standard-version": "9.3.2",
"typescript": "4.6.2",
"unbuild": "0.7.0",
"vite": "2.8.6",
"vitest": "0.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"~/*": ["./playground/*"]
}
},
"include": ["src", "playground", "env.d.ts", "tests"]
"include": ["src", "playground", "tests"]
}
29 changes: 0 additions & 29 deletions vite.config.ts

This file was deleted.

14 changes: 14 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { resolve } from 'path';
import { defineConfig } from 'vitest/config';

export default defineConfig({
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'~': resolve(__dirname, './playground'),
},
},
test: {
// ...
},
});
Loading

0 comments on commit 10f1aaf

Please sign in to comment.