Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
How do I remove vue spec files from vite config

I've succesfully added vite to my project. It builds fine for prodiction. However in Production I have an error

Uncaught ReferenceError: describe is not defined at index.ba9d79ff.js:1119:1426

I then saw the my .spec files where being added. I thought vite would of handled the removal of the test files. I want to remove my .spec files from production. but not having such luck. I'm using Vue 2 with vite. I added

production: {
 exclude: ['src/components/**/*.{spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
},

but the files are still being added. Is there something more I need to do?

My config

import { defineConfig } from "vite";
import { createVuePlugin as vue } from "vite-plugin-vue2";
import { VuetifyResolver } from "unplugin-vue-components/resolvers";
import Components from "unplugin-vue-components/vite";

// https://vitejs.dev/config/const
const path = require("path");
export default defineConfig({
  plugins: [
    vue(),
    Components({
      resolvers: [
        // Vuetify
        VuetifyResolver(),
      ],
    }),
  ],
  resolve: {
    extensions: [
      ".mjs",
      ".js",
      ".ts",
      ".jsx",
      ".tsx",
      ".json",
      ".vue",
      ".scss",
    ],
    alias: {
      "@": path.resolve(__dirname, "./src"),
      json2csv: "json2csv/dist/json2csv.umd.js",
      "~bootstrap": "bootstrap",
    },
  },
  production: {
    exclude: ['src/components/**/*.{spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}']
  },
  extensions: etc,
  css: {
    preprocessorOptions: {
      scss: {
        //  additionalData: `@import "src/scss/app.scss";`,
        // additionalData: `@import "src/scss/_variables.scss";`,
        sourceMap: false,
        additionalData(source, fp) {
          // All scss files ending with imports.scss
          // will not re-import additionalData
          if (fp.endsWith("_variables.scss")) return source;
          // Use additionalData from legacy nuxt scss options
          // return `@import "@/assets/mixin.scss"; ${source}`;
          return `@import "src/scss/_variables.scss"; ${source}`;
        },
      },
    },
  },
  server: {
    port: 8090,
  },
});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda