diff --git a/.eslintrc.js b/.eslintrc.js index 6dfc3b8b09..c961dd2f5a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,6 +7,8 @@ module.exports = { oc_userconfig: true, appName: true, appVersion: true, + TRANSLATIONS: true, + SCOPE_VERSION: true, }, extends: [ '@nextcloud', diff --git a/package-lock.json b/package-lock.json index 28b98a1a50..848f8c213b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,8 @@ "@nextcloud/browserslist-config": "^2.3.0", "@nextcloud/eslint-config": "github:nextcloud/eslint-config#8fe45614b68e95639b64d6d3bac2d6821c1bb1af", "@nextcloud/stylelint-config": "^2.3.0", + "@rollup/plugin-commonjs": "^23.0.4", + "@rollup/plugin-replace": "^5.0.1", "@vitejs/plugin-vue": "^4.0.0", "@vitest/coverage-c8": "^0.25.7", "@vue/compiler-sfc": "^3.2.45", @@ -63,7 +65,6 @@ "gettext-extractor": "^3.6.0", "gettext-parser": "^6.0.0", "jsdom": "^20.0.3", - "rollup-plugin-inject-process-env": "^1.3.1", "rollup-plugin-node-externals": "^5.0.2", "sanitize-filename": "^1.6.3", "sass": "^1.56.2", @@ -2673,6 +2674,144 @@ "node": ">= 8" } }, + "node_modules/@rollup/plugin-commonjs": { + "version": "23.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.4.tgz", + "integrity": "sha512-bOPJeTZg56D2MCm+TT4psP8e8Jmf1Jsi7pFUMl8BN5kOADNzofNHe47+84WVCt7D095xPghC235/YKuNDEhczg==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^8.0.3", + "is-reference": "1.2.1", + "magic-string": "^0.26.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", + "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.8" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/minimatch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", + "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@rollup/plugin-replace": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.1.tgz", + "integrity": "sha512-Z3MfsJ4CK17BfGrZgvrcp/l6WXoKb0kokULO+zt/7bmcyayokDaQ2K3eDJcRLCTAlp5FPI4/gz9MHAsosz4Rag==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "magic-string": "^0.26.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-replace/node_modules/magic-string": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", + "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "dev": true, + "dependencies": { + "sourcemap-codec": "^1.4.8" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "dev": true + }, "node_modules/@skjnldsv/sanitize-svg": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@skjnldsv/sanitize-svg/-/sanitize-svg-1.0.2.tgz", @@ -2735,8 +2874,7 @@ "version": "0.0.51", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@types/glob": { "version": "7.2.0", @@ -4413,6 +4551,12 @@ "node": ">=4.0.0" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -7931,6 +8075,15 @@ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", "dev": true }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -10397,15 +10550,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rollup-plugin-inject-process-env": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-inject-process-env/-/rollup-plugin-inject-process-env-1.3.1.tgz", - "integrity": "sha512-kKDoL30IZr0wxbNVJjq+OS92RJSKRbKV6B5eNW4q3mZTFqoWDh6lHy+mPDYuuGuERFNKXkG+AKxvYqC9+DRpKQ==", - "dev": true, - "dependencies": { - "magic-string": "^0.25.7" - } - }, "node_modules/rollup-plugin-node-externals": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/rollup-plugin-node-externals/-/rollup-plugin-node-externals-5.0.3.tgz", @@ -14720,6 +14864,102 @@ "fastq": "^1.6.0" } }, + "@rollup/plugin-commonjs": { + "version": "23.0.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.4.tgz", + "integrity": "sha512-bOPJeTZg56D2MCm+TT4psP8e8Jmf1Jsi7pFUMl8BN5kOADNzofNHe47+84WVCt7D095xPghC235/YKuNDEhczg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^8.0.3", + "is-reference": "1.2.1", + "magic-string": "^0.26.4" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.0.3.tgz", + "integrity": "sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + } + }, + "magic-string": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", + "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, + "minimatch": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", + "integrity": "sha512-362NP+zlprccbEt/SkxKfRMHnNY85V74mVnpUpNyr3F35covl09Kec7/sEFLt3RA4oXmewtoaanoIf67SE5Y5g==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } + } + }, + "@rollup/plugin-replace": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.1.tgz", + "integrity": "sha512-Z3MfsJ4CK17BfGrZgvrcp/l6WXoKb0kokULO+zt/7bmcyayokDaQ2K3eDJcRLCTAlp5FPI4/gz9MHAsosz4Rag==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "magic-string": "^0.26.4" + }, + "dependencies": { + "magic-string": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", + "integrity": "sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + } + } + }, + "@rollup/pluginutils": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", + "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "dependencies": { + "@types/estree": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", + "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "dev": true + } + } + }, "@skjnldsv/sanitize-svg": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@skjnldsv/sanitize-svg/-/sanitize-svg-1.0.2.tgz", @@ -14775,8 +15015,7 @@ "version": "0.0.51", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true, - "peer": true + "dev": true }, "@types/glob": { "version": "7.2.0", @@ -16073,6 +16312,12 @@ "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", "dev": true }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -18692,6 +18937,15 @@ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", "dev": true }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -20569,15 +20823,6 @@ "fsevents": "~2.3.2" } }, - "rollup-plugin-inject-process-env": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-inject-process-env/-/rollup-plugin-inject-process-env-1.3.1.tgz", - "integrity": "sha512-kKDoL30IZr0wxbNVJjq+OS92RJSKRbKV6B5eNW4q3mZTFqoWDh6lHy+mPDYuuGuERFNKXkG+AKxvYqC9+DRpKQ==", - "dev": true, - "requires": { - "magic-string": "^0.25.7" - } - }, "rollup-plugin-node-externals": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/rollup-plugin-node-externals/-/rollup-plugin-node-externals-5.0.3.tgz", diff --git a/package.json b/package.json index 411d2f8108..05dbe53744 100644 --- a/package.json +++ b/package.json @@ -29,11 +29,11 @@ "cypress:gui": "cypress open --component", "cypress:update-snapshots": "cypress run --component --spec cypress/visual/**/*.cy.js --env type=base --config screenshotsFolder=cypress/snapshots/base" }, - "main": "dist/index.umd.js", + "main": "dist/index.cjs.js", "module": "dist/index.esm.js", "exports": { "import": "./dist/index.esm.js", - "require": "./dist/index.umd.js" + "require": "./dist/index.cjs.js" }, "files": [ "CHANGELOG.md", @@ -90,6 +90,8 @@ "@nextcloud/browserslist-config": "^2.3.0", "@nextcloud/eslint-config": "github:nextcloud/eslint-config#8fe45614b68e95639b64d6d3bac2d6821c1bb1af", "@nextcloud/stylelint-config": "^2.3.0", + "@rollup/plugin-commonjs": "^23.0.4", + "@rollup/plugin-replace": "^5.0.1", "@vitejs/plugin-vue": "^4.0.0", "@vitest/coverage-c8": "^0.25.7", "@vue/compiler-sfc": "^3.2.45", @@ -103,13 +105,12 @@ "gettext-extractor": "^3.6.0", "gettext-parser": "^6.0.0", "jsdom": "^20.0.3", - "rollup-plugin-inject-process-env": "^1.3.1", "rollup-plugin-node-externals": "^5.0.2", "sanitize-filename": "^1.6.3", "sass": "^1.56.2", "vite": "^4.0.0", - "vitest": "^0.25.7", "vitepress": "^1.0.0-alpha.31", + "vitest": "^0.25.7", "vue-docgen-cli": "^4.56.1", "vue-eslint-parser": "^9.1.0", "vue-live": "^2.3.2" diff --git a/src/components/NcMultiselect/NcMultiselect.vue b/src/components/NcMultiselect/NcMultiselect.vue index 3256c0b95f..1bd73636f5 100644 --- a/src/components/NcMultiselect/NcMultiselect.vue +++ b/src/components/NcMultiselect/NcMultiselect.vue @@ -238,7 +238,6 @@ import NcListItemIcon from '../NcListItemIcon/index.js' import NcLoadingIcon from '../NcLoadingIcon/index.js' import Tooltip from '../../directives/Tooltip/index.js' import l10n from '../../mixins/l10n.js' - import { Multiselect as VueMultiselect } from 'vue-multiselect' if (!PRODUCTION) { @@ -368,7 +367,7 @@ export default { return { elWidth: 0, ariaExpanded: false, - scoping: { [`data-v-${process.env.SCOPE_VERSION}`]: '' }, + scoping: { [`data-v-${SCOPE_VERSION}`]: '' }, } }, computed: { diff --git a/src/l10n.js b/src/l10n.js index 42b8ba797d..560b9b3787 100644 --- a/src/l10n.js +++ b/src/l10n.js @@ -4,37 +4,35 @@ const gtBuilder = getGettextBuilder() .detectLocale() // Decompress Translations to gettext format and add to gtBuilder -if (Array.isArray(process.env.TRANSLATIONS)) { - process.env.TRANSLATIONS.forEach((lang) => { - const translations = {} - - for (const key in lang.translations) { - // Plural - if (lang.translations[key].pluralId) { - translations[key] = { - msgid: key, - msgid_plural: lang.translations[key].pluralId, - msgstr: lang.translations[key].msgstr, - } - continue - } +TRANSLATIONS.forEach((lang) => { + const translations = {} - // Singular + for (const key in lang.translations) { + // Plural + if (lang.translations[key].pluralId) { translations[key] = { msgid: key, - msgstr: [ - lang.translations[key], - ], + msgid_plural: lang.translations[key].pluralId, + msgstr: lang.translations[key].msgstr, } + continue + } + + // Singular + translations[key] = { + msgid: key, + msgstr: [ + lang.translations[key], + ], } + } - gtBuilder.addTranslation(lang.locale, { - translations: { - '': translations, - }, - }) + gtBuilder.addTranslation(lang.locale, { + translations: { + '': translations, + }, }) -} +}) const gt = gtBuilder.build() diff --git a/src/utils/ScopeComponent.js b/src/utils/ScopeComponent.js index 3289ab8820..8c96282852 100644 --- a/src/utils/ScopeComponent.js +++ b/src/utils/ScopeComponent.js @@ -30,7 +30,7 @@ const ScopeComponent = (Component) => { // Inject root scoping function Component.mounted.push(function() { - this.$el.setAttribute(`data-v-${process.env.SCOPE_VERSION}`, '') + this.$el.setAttribute(`data-v-${SCOPE_VERSION}`, '') }) } diff --git a/vite.config.mjs b/vite.config.mjs index 111e218f91..54ee2f6647 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,8 +1,9 @@ import md5 from 'md5' import vue from '@vitejs/plugin-vue' -import { externals } from 'rollup-plugin-node-externals' +import replace from '@rollup/plugin-replace' +import commonjs from '@rollup/plugin-commonjs' import browserslistToEsbuild from 'browserslist-to-esbuild' -import injectProcessEnv from 'rollup-plugin-inject-process-env' +import { externals } from 'rollup-plugin-node-externals' import { loadTranslations } from './resources/translations.mjs' import { fileURLToPath, URL } from 'url' import { dirname, resolve } from 'path' @@ -21,9 +22,9 @@ const SCOPE_VERSION = md5(appVersion).slice(0, 7) console.info('This build version hash is', SCOPE_VERSION, '\n') -const processEnvironment = { - TRANSLATIONS: loadTranslations(resolve(__dirname, './l10n')), - SCOPE_VERSION, +const globalVariables = { + TRANSLATIONS: JSON.stringify(loadTranslations(resolve(__dirname, './l10n'))), + SCOPE_VERSION: JSON.stringify(SCOPE_VERSION), } // Plugin for stripping out sections from vue files @@ -65,16 +66,29 @@ export default defineConfig({ sourcemap: true, rollupOptions: { plugins: [ + commonjs(), externals(), - injectProcessEnv(processEnvironment), + replace({ + preventAssignment: true, + delimiters: ['\\b', '\\b'], + include: 'src/**/*', + values: globalVariables, + }), ], external: [ ...Object.keys(loadJSON('./package.json').peerDependencies), + ...Object.keys(loadJSON('./package.json').dependencies), ], + output: { + globals: { + vue: 'vue', + }, + }, }, lib: { name: 'NextcloudVue', entry: resolve(__dirname, 'src/index.js'), + formats: ['es', 'cjs'], fileName: (format, entry) => { return `${entry}.${format === 'es' ? 'esm' : format}.js` }, @@ -83,6 +97,5 @@ export default defineConfig({ test: { environment: 'jsdom', setupFiles: resolve(__dirname, './tests/setup.js'), - env: processEnvironment, }, })