Skip to content

Commit

Permalink
Initialise TypeScript project for Vue plugin w/ CJS+ESM dist
Browse files Browse the repository at this point in the history
  • Loading branch information
jaseeey committed Apr 15, 2024
1 parent ff5fde2 commit f505e14
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
coverage/
dist/
node_modules/
306 changes: 306 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@jaseeey/vue-umami-plugin",
"version": "0.0.1",
"description": "A plugin designed for Vue 3 which enables the use of Umami Analytics",
"license": "MIT",
"author": "Jason Ilicic <[email protected]>",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/jaseeey/vue-umami-plugin.git"
},
"bugs": {
"url": "https://github.com/jaseeey/vue-umami-plugin/issues"
},
"homepage": "https://github.com/jaseeey/vue-umami-plugin#readme",
"keywords": [
"vue",
"umami"
],
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"exports": {
".": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
}
},
"devDependencies": {
"typescript": "^5.4.3",
"vue-router": "^4.3.0"
},
"scripts": {
"build:esm": "tsc -p tsconfig.esm.json",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build": "npm run build:esm && npm run build:cjs",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
}
}
9 changes: 9 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"outDir": "./dist/cjs",
"declaration": true
},
"include": ["src/**/*"]
}
11 changes: 11 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"outDir": "./dist/esm",
"declaration": true
},
"include": [
"src/**/*"
]
}
17 changes: 17 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"declaration": true,
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node"
},
"include": [
"global.d.ts",
"src/**/*"
]
}

0 comments on commit f505e14

Please sign in to comment.