Skip to content

Commit 64a066c

Browse files
committed
[TASK] Build real package for distribution test
1 parent b64d951 commit 64a066c

File tree

7 files changed

+10
-5
lines changed

7 files changed

+10
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
node_modules
22
dist
33
coverage
4+
tests/distribution/package
5+
tests/distribution/vite-plugin-typo3*.tgz
46
tests/distribution/**/public
57
tests/integration/project/public
68
tests/integration/project/packages/test_extension/Resources/Public

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"format": "prettier --write .",
3535
"test": "vitest run",
3636
"test:coverage": "vitest run --coverage",
37-
"test:distribution": "npm run test:distribution:cjs && npm run test:distribution:esm && npm run test:distribution:ts",
37+
"test:distribution": "npm run test:distribution:pack && npm run test:distribution:cjs && npm run test:distribution:esm && npm run test:distribution:ts",
38+
"test:distribution:pack": "npm pack --pack-destination tests/distribution/ && cd tests/distribution/ && tar xzf vite-plugin-typo3*.tgz",
3839
"test:distribution:cjs": "cd tests/distribution/javascript-cjs/ && npm install --package-lock=false && npm run build",
3940
"test:distribution:esm": "cd tests/distribution/javascript-esm/ && npm install --package-lock=false && npm run build",
4041
"test:distribution:ts": "cd tests/distribution/typescript/ && npm install --package-lock=false && npm run build && npm run typecheck"

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import autoOrigin from "vite-plugin-auto-origin";
22
import type { UserConfig } from "./types.js";
33
import typo3project from "./typo3project.js";
44
import typo3extension from "./typo3extension.js";
5+
import { PluginOption } from "vite";
56

6-
export default function typo3(userConfig: UserConfig = {}) {
7+
export default function typo3(userConfig: UserConfig = {}): PluginOption[] {
78
if (userConfig.target === "extension") {
89
return [typo3extension(userConfig)];
910
} else {

tests/distribution/javascript-cjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "typo3-plugin-javascript-cjs-test",
33
"devDependencies": {
44
"vite": "^5.2.11",
5-
"vite-plugin-typo3": "file:../../../"
5+
"vite-plugin-typo3": "file:../package/"
66
},
77
"scripts": {
88
"build": "vite build"

tests/distribution/javascript-esm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"devDependencies": {
55
"vite": "^5.2.11",
6-
"vite-plugin-typo3": "file:../../../"
6+
"vite-plugin-typo3": "file:../package/"
77
},
88
"scripts": {
99
"build": "vite build"

tests/distribution/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"devDependencies": {
55
"typescript": "^5.4.5",
66
"vite": "^5.2.11",
7-
"vite-plugin-typo3": "file:../../../"
7+
"vite-plugin-typo3": "file:../package/"
88
},
99
"scripts": {
1010
"build": "vite build",

tests/distribution/typescript/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"moduleDetection": "force",
99
"strict": true,
1010
"noUncheckedIndexedAccess": true,
11+
"preserveSymlinks": true,
1112

1213
"moduleResolution": "nodenext",
1314
"module": "nodenext",

0 commit comments

Comments
 (0)