Skip to content

Commit

Permalink
Fix Vue
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Ayers <[email protected]>
  • Loading branch information
smaye81 committed Jul 31, 2024
1 parent 9ec41a3 commit 721ec13
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 38 deletions.
42 changes: 42 additions & 0 deletions vue/cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { defineConfig } from "cypress";
import webpackPreprocessor from "@cypress/webpack-preprocessor";
import ResolveTypeScriptPlugin from "resolve-typescript-plugin";

// Note that vue scaffolds a cypress config with a .ts extension, but this doesn't
// work with ESM modules. Renaming this file to have a .js extension fixes the issue.
// See: https://github.com/cypress-io/cypress/issues/23552

const options = {
webpackOptions: {
resolve: {
extensions: [".ts", ".tsx", ".js"],
plugins: [new ResolveTypeScriptPlugin()],
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
options: { transpileOnly: true },
},
],
},
},
};

export default defineConfig({
e2e: {
specPattern: "cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}",
baseUrl: "http://localhost:4173",
setupNodeEvents(on) {
on("file:preprocessor", webpackPreprocessor(options));
},
},

component: {
devServer: {
framework: "vue",
bundler: "vite",
},
},
});
38 changes: 0 additions & 38 deletions vue/cypress.config.ts

This file was deleted.

1 change: 1 addition & 0 deletions vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "buf-vue",
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "vite",
"build": "run-p type-check build-only",
Expand Down

0 comments on commit 721ec13

Please sign in to comment.