Skip to content

Commit

Permalink
Migrate to ES6 modules
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
undergroundwires committed Aug 17, 2023
1 parent 6a20d80 commit 20bdcb7
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions cypress.config.ts
@@ -1,12 +1,13 @@
import { defineConfig } from 'cypress'
import { defineConfig } from 'cypress';
import setupPlugins from './tests/e2e/plugins/index.js';

export default defineConfig({
fixturesFolder: 'tests/e2e/fixtures',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
e2e: {
setupNodeEvents(on, config) {
return require('./tests/e2e/plugins/index.js')(on, config)
return setupPlugins(on, config);
},
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'tests/e2e/support/index.js',
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -5,6 +5,7 @@
"slogan": "Now you have the choice",
"description": "Enforce privacy & security best-practices on Windows, macOS and Linux, because privacy is sexy 🍑🍆",
"author": "undergroundwires",
"type": "module",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/e2e/plugins/index.js
Expand Up @@ -9,7 +9,7 @@
// /* eslint-disable import/no-extraneous-dependencies, global-require */
// const webpack = require('@cypress/webpack-preprocessor')

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

0 comments on commit 20bdcb7

Please sign in to comment.