Skip to content

Commit 55c16db

Browse files
committed
feat(vite): update to Vite 3 to improve component tree shaking
1 parent 194c5e3 commit 55c16db

File tree

126 files changed

+2162
-1839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+2162
-1839
lines changed

cypress.config.js

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
const path = require('path')
2+
const vue = require('@vitejs/plugin-vue')
3+
const { defineConfig } = require('cypress')
4+
const codeCoverageTask = require('@cypress/code-coverage/task')
5+
const istanbul = require('vite-plugin-istanbul')
6+
7+
module.exports = defineConfig({
8+
video: false,
9+
numTestsKeptInMemory: 5,
10+
retries: {
11+
runMode: 1,
12+
openMode: 0,
13+
},
14+
e2e: {
15+
// setupNodeEvents(on, config) {},
16+
},
17+
component: {
18+
devServer: {
19+
framework: 'vue',
20+
bundler: 'vite',
21+
viteConfig: {
22+
logLevel: 'silent',
23+
resolve: {
24+
alias: {
25+
'@': path.resolve(__dirname, 'src'),
26+
'@module': path.resolve(__dirname, 'node_modules'),
27+
vue: path.resolve(
28+
__dirname,
29+
'node_modules',
30+
'vue',
31+
'dist',
32+
'vue.esm-bundler.js'
33+
),
34+
},
35+
},
36+
plugins: [
37+
vue(),
38+
istanbul({
39+
include: ['src/components', 'src/composables', 'src/utils'],
40+
exclude: [
41+
'node_modules',
42+
'^src/**',
43+
'**/*.test.js',
44+
'**/*.stories.js',
45+
'**/*.fixtures.js',
46+
],
47+
cypress: true,
48+
requireEnv: false,
49+
extension: ['.js', '.vue'],
50+
}),
51+
],
52+
build: {
53+
sourcemap: true,
54+
},
55+
},
56+
},
57+
setupNodeEvents(on, config) {
58+
codeCoverageTask(on, config)
59+
60+
return config
61+
},
62+
port: 3030,
63+
specPattern: 'src/components/**/*.test.js',
64+
},
65+
})

cypress.json

-13
This file was deleted.
File renamed without changes.

cypress/plugins/index.js

-72
This file was deleted.

cypress/support/component-index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Components App</title>
8+
</head>
9+
<body>
10+
<div data-cy-root></div>
11+
</body>
12+
</html>

cypress/support/component.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// ***********************************************************
2+
// This example support/component.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import Cypress Real Event plugin.
17+
// https://github.com/dmtrKovalenko/cypress-real-events
18+
import 'cypress-real-events/support'
19+
20+
// Import commands.js using ES2015 syntax:
21+
import './commands'
22+
23+
// Import Cypress code coverage plugin.
24+
import '@cypress/code-coverage/support'
25+
26+
// Alternatively you can use CommonJS syntax:
27+
// require('./commands')
28+
29+
import { mount } from 'cypress/vue'
30+
31+
Cypress.Commands.add('mount', mount)
32+
33+
// Example use:
34+
// cy.mount(MyComponent)
File renamed without changes.

0 commit comments

Comments
 (0)