Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next] feat(cypress): use vite instead of webpack #4619

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 4 additions & 41 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
import { defineConfig } from 'cypress'
import webpack from 'webpack'
import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin.js'
import path from 'path'
import webpackConfig from '@nextcloud/webpack-vue-config'
import webpackRules from '@nextcloud/webpack-vue-config/rules.js'

import { loadTranslations } from './build/translations.js'

const SCOPE_VERSION = Date.now();

(webpackRules.RULE_SCSS.use as webpack.RuleSetUse[]).push({
loader: 'sass-loader',
options: {
additionalData: `@use 'sass:math'; $scope_version:${SCOPE_VERSION}; @import 'variables'; @import 'material-icons';`,
/**
* ! needed for resolve-url-loader
*/
sourceMap: true,
sassOptions: {
sourceMapContents: false,
includePaths: [
path.resolve(__dirname, './src/assets'),
],
},
},
})

webpackConfig.module.rules = Object.values(webpackRules)
import getCompareSnapshotsPlugin from 'cypress-visual-regression/dist/plugin'

export default defineConfig({
projectId: '3paxvy',
Expand Down Expand Up @@ -67,27 +40,17 @@ export default defineConfig({
})

},

excludeSpecPattern: [
'cypress/component/modal.cy.ts',
'cypress/component/richtext.cy.ts',
'cypress/visual/**/*.js',
],


devServer: {
framework: 'vue',
bundler: 'webpack',
webpackConfig: async () => {
const translations = await loadTranslations(path.resolve(__dirname, './l10n'))
webpackConfig.plugins.push(new webpack.DefinePlugin({
PRODUCTION: false,
SCOPE_VERSION,
TRANSLATIONS: JSON.stringify(translations),
}))

return webpackConfig
},
bundler: 'vite',
},
},
})
Loading