Skip to content

Commit 804ca09

Browse files
committed
feat: Migrate to Vite for building / transpiling
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent ee2db24 commit 804ca09

5 files changed

Lines changed: 21 additions & 50 deletions

File tree

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
"name": "@nextcloud/auth",
33
"version": "2.2.1",
44
"description": "Nextcloud helpers related to authentication and the current user",
5-
"main": "dist/index.js",
5+
"type": "module",
6+
"main": "dist/index.cjs",
67
"types": "dist/index.d.ts",
78
"exports": {
89
"types": "./dist/index.d.ts",
9-
"import": "./dist/index.es.mjs",
10-
"require": "./dist/index.js"
10+
"import": "./dist/index.mjs",
11+
"require": "./dist/index.cjs"
1112
},
1213
"files": [
1314
"dist/"
1415
],
1516
"scripts": {
16-
"build": "rollup --config rollup.config.mjs",
17+
"build": "vite --mode production build",
1718
"build:doc": "typedoc --out dist/doc lib/index.ts && touch dist/doc/.nojekyll",
18-
"check-types": "tsc --noEmit",
19+
"dev": "vite --mode development run --watch",
1920
"dev": "rollup --config rollup.config.mjs --watch",
2021
"lint": "eslint lib *js",
2122
"lint:fix": "eslint --fix lib",
@@ -38,14 +39,10 @@
3839
"devDependencies": {
3940
"@nextcloud/eslint-config": "^8.3.0",
4041
"@nextcloud/typings": "^1.8.0",
41-
"@rollup/plugin-typescript": "^11.1.6",
4242
"eslint": "^8.57.0",
43-
"jest": "^29.7.0",
44-
"jest-environment-jsdom": "^29.7.0",
45-
"rollup": "^4.16.0",
46-
"tslib": "^2.6.2",
4743
"typedoc": "^0.25.13",
48-
"typescript": "^5.4.5"
44+
"typescript": "^5.4.5",
45+
"vite": "^5.2.10"
4946
},
5047
"engines": {
5148
"node": "^20.0.0",

rollup.config.mjs

Lines changed: 0 additions & 35 deletions
This file was deleted.

tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"include": ["./lib/**/*.ts"],
2+
"include": ["./lib/**.ts"],
33
"compilerOptions": {
44
"allowSyntheticDefaultImports": true,
5-
"moduleResolution": "node",
5+
"moduleResolution": "Bundler",
66
"target": "ESNext",
7-
"module": "esnext",
7+
"module": "ESNext",
88
"declaration": true,
99
"strict": true,
1010
"noImplicitAny": false,

vite.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createLibConfig } from '@nextcloud/vite-config'
2+
3+
export default createLibConfig(
4+
{
5+
index: `${__dirname}/lib/index.ts`,
6+
},
7+
{
8+
libraryFormats: ['cjs', 'es'],
9+
},
10+
)

0 commit comments

Comments
 (0)