Skip to content

Commit 34ce215

Browse files
committed
Package ESM and CJS
1 parent 3a1545b commit 34ce215

File tree

7 files changed

+329
-31
lines changed

7 files changed

+329
-31
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { readGitignoreFiles } = require('eslint-gitignore');
55
module.exports = defineConfig({
66
ignorePatterns: [
77
...readGitignoreFiles(),
8-
'.eslintrc.js', // Skip self linting
8+
'.eslintrc.cjs', // Skip self linting
99
],
1010
root: true,
1111
env: {
@@ -102,10 +102,12 @@ module.exports = defineConfig({
102102
'inheritdoc',
103103
'jsdoc',
104104
'jsdom',
105+
'minify',
105106
'noninteraction',
106107
'nullish',
107108
'overridable',
108109
'readonly',
110+
'vite',
109111
'vitest',
110112
'vue',
111113
],

package.json

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,27 @@
22
"name": "@gtm-support/vue-gtm",
33
"version": "2.0.0-beta.3",
44
"description": "Simple implementation of Google Tag Manager for Vue",
5-
"main": "dist/index.js",
5+
"scripts": {
6+
"clean": "rimraf coverage dist pnpm-lock.yaml node_modules",
7+
"build": "tsc --noEmit && vite build",
8+
"format": "prettier --write .",
9+
"lint": "eslint .",
10+
"test": "vitest",
11+
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build"
12+
},
13+
"type": "module",
14+
"files": [
15+
"dist"
16+
],
17+
"main": "dist/index.cjs",
18+
"module": "dist/index.js",
19+
"types": "dist/index.d.ts",
20+
"exports": {
21+
".": {
22+
"import": "./dist/index.js",
23+
"require": "./dist/index.cjs"
24+
}
25+
},
626
"author": {
727
"name": "Christopher Quadflieg",
828
"email": "chrissi92@hotmail.de",
@@ -16,14 +36,6 @@
1636
],
1737
"license": "MIT",
1838
"homepage": "https://github.com/gtm-support/vue-gtm",
19-
"scripts": {
20-
"clean": "rm -Rf dist pnpm-lock.yaml node_modules",
21-
"build": "tsc",
22-
"format": "prettier --write .",
23-
"lint": "eslint .",
24-
"test": "vitest",
25-
"prepublishOnly": "pnpm run clean && pnpm install && pnpm run build"
26-
},
2739
"repository": {
2840
"type": "git",
2941
"url": "https://github.com/gtm-support/vue-gtm.git"
@@ -50,13 +62,8 @@
5062
"vue",
5163
"google"
5264
],
53-
"files": [
54-
"dist",
55-
"src",
56-
"tsconfig.json"
57-
],
5865
"dependencies": {
59-
"@gtm-support/core": "^1.4.2"
66+
"@gtm-support/core": "^2.0.0-beta.1"
6067
},
6168
"devDependencies": {
6269
"@typescript-eslint/eslint-plugin": "~5.39.0",
@@ -71,7 +78,10 @@
7178
"jsdom": "~20.0.1",
7279
"prettier": "2.7.1",
7380
"prettier-plugin-organize-imports": "~3.1.1",
81+
"rimraf": "~3.0.2",
7482
"typescript": "~4.8.4",
83+
"vite": "~3.1.6",
84+
"vite-plugin-dts": "~1.6.5",
7585
"vitest": "~0.23.4",
7686
"vue": "^3.2.40",
7787
"vue-router": "^4.1.5"

0 commit comments

Comments
 (0)