Skip to content

Commit

Permalink
Merge pull request #4329 from nextcloud/feat/cjs-module-entry-to-vite
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Jul 14, 2023
2 parents 5891d76 + 70ef337 commit 32eaecb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
},
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
},
})
Expand Down Expand Up @@ -43,6 +43,11 @@ module.exports = async () => {
},
},
},
resolve: {
alias: {
vue: 'vue/dist/vue.js',
},
},
}),

exampleMode: 'collapse',
Expand Down
4 changes: 2 additions & 2 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32eaecb

Please sign in to comment.