diff --git a/package-lock.json b/package-lock.json index f2a71d42cb..4ec7d5594c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,7 +62,7 @@ "@nextcloud/eslint-config": "^8.3.0-beta.0", "@nextcloud/stylelint-config": "^2.3.1", "@nextcloud/webpack-vue-config": "github:nextcloud/webpack-vue-config#master", - "@susnux/nextcloud-vite-config": "^1.0.0-beta.13", + "@susnux/nextcloud-vite-config": "^1.0.0-beta.15", "@vue/test-utils": "^1.3.0", "@vue/tsconfig": "^0.4.0", "@vue/vue2-jest": "^29.0.0", diff --git a/package.json b/package.json index 4574e80c79..bde04f1fcc 100644 --- a/package.json +++ b/package.json @@ -31,11 +31,11 @@ "cypress:gui": "TZ=UTC cypress open --component", "cypress:update-snapshots": "TZ=UTC cypress run --component --spec cypress/visual/**/*.cy.js --env type=base --config screenshotsFolder=cypress/snapshots/base" }, - "main": "dist/index.js", + "main": "dist/index.cjs", "exports": { ".": { "import": "./dist/index.mjs", - "require": "./dist/index.js" + "require": "./dist/index.cjs" }, "./dist/": "./dist/" }, @@ -103,7 +103,7 @@ "@nextcloud/eslint-config": "^8.3.0-beta.0", "@nextcloud/stylelint-config": "^2.3.1", "@nextcloud/webpack-vue-config": "github:nextcloud/webpack-vue-config#master", - "@susnux/nextcloud-vite-config": "^1.0.0-beta.13", + "@susnux/nextcloud-vite-config": "^1.0.0-beta.15", "@vue/test-utils": "^1.3.0", "@vue/tsconfig": "^0.4.0", "@vue/vue2-jest": "^29.0.0", diff --git a/styleguide.config.js b/styleguide.config.js index 3ee1f458c6..bd2ad2ee54 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -15,7 +15,7 @@ module.exports = async () => { module: { // Ignore eslint rules: base.module.rules.filter( - rule => rule.use !== 'eslint-loader' + rule => rule.use !== 'eslint-loader', ), }, }) @@ -43,6 +43,11 @@ module.exports = async () => { }, }, }, + resolve: { + alias: { + vue: 'vue/dist/vue.js', + }, + }, }), exampleMode: 'collapse', diff --git a/vite.config.mts b/vite.config.mts index 8668448cfe..15e0df1d9b 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -66,8 +66,8 @@ export default defineConfig((env) => { }, // For backwards compatibility we include the css within the js files inlineCSS: true, - // Disable polyfills - coreJS: false, + // Build CommonJS files for backwards compatibility + libraryFormats: ['es', 'cjs'], replace: { PRODUCTION: JSON.stringify(env.mode === 'production'), SCOPE_VERSION, diff --git a/webpack.config.js b/webpack.config.js index e6de015e64..c69ae7b3fb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,7 +23,6 @@ console.info('This build version hash is', versionHash, '\n') webpackConfig.entry = { install: path.join(__dirname, 'src', 'install.js'), - index: path.join(__dirname, 'src', 'index.js'), ...globSync('src/components/*/index.js').reduce((acc, item) => { const name = item