Skip to content

Commit 20bdcb7

Browse files
Migrate to ES6 modules
Configure project to use ES6 modules to enable top-level await capabilities. This change helps project to align well with modern JS standards. - Set `type` to `module` in `package.json`. - Use import/export syntax in Cypress configuration files. - Rename configurations files that do not support modules to use the `.cjs` extension: - `vue.config.js` to `vue.config.cjs` (vuejs/vue-cli#4477). - `babel.config.js` to `babel.config.cjs (babel/babel-loader#894) - `.eslintrc.js` to `.eslintrc.cjs` (eslint/eslint#13440, eslint/eslint#14137) - `postcss.config.js` to `postcss.config.cjs` (postcss/postcss#1771)
1 parent 6a20d80 commit 20bdcb7

File tree

8 files changed

+5
-3
lines changed

8 files changed

+5
-3
lines changed
File renamed without changes.
File renamed without changes.

cypress.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { defineConfig } from 'cypress'
1+
import { defineConfig } from 'cypress';
2+
import setupPlugins from './tests/e2e/plugins/index.js';
23

34
export default defineConfig({
45
fixturesFolder: 'tests/e2e/fixtures',
56
screenshotsFolder: 'tests/e2e/screenshots',
67
videosFolder: 'tests/e2e/videos',
78
e2e: {
89
setupNodeEvents(on, config) {
9-
return require('./tests/e2e/plugins/index.js')(on, config)
10+
return setupPlugins(on, config);
1011
},
1112
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
1213
supportFile: 'tests/e2e/support/index.js',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"slogan": "Now you have the choice",
66
"description": "Enforce privacy & security best-practices on Windows, macOS and Linux, because privacy is sexy 🍑🍆",
77
"author": "undergroundwires",
8+
"type": "module",
89
"scripts": {
910
"serve": "vue-cli-service serve",
1011
"build": "vue-cli-service build",
File renamed without changes.
File renamed without changes.

tests/e2e/plugins/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// /* eslint-disable import/no-extraneous-dependencies, global-require */
1010
// const webpack = require('@cypress/webpack-preprocessor')
1111

12-
module.exports = (on, config) => {
12+
export default (on, config) => {
1313
// on('file:preprocessor', webpack({
1414
// webpackOptions: require('@vue/cli-service/webpack.config'),
1515
// watchOptions: {}
File renamed without changes.

0 commit comments

Comments
 (0)