Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't resolve globs in files config when using a custom root directory in vite #5

Open
igarrido-adalab opened this issue Nov 29, 2023 · 0 comments

Comments

@igarrido-adalab
Copy link
Contributor

When I run npm run build with Vite (Vite version v4.5.0 in Ubuntu 23.10) using the files setting, it doesn't find any js files.
I'm using a custom Vite configuration as the following vite.config.js:

/ vite.config.js
import { defineConfig } from "vite";
// Concatenate JavaScript files (like former Starter Kit)
import concat from '@vituum/vite-plugin-concat'

export default defineConfig({
  base: "./",
  root: "src",
  publicDir: "../public",
  build: {
    minify: "esbuild",
    outDir: "../docs",
    sourcemap: "inline",
    emptyOutDir: true,
  },
  server: {
    open: "/index.html",
  },
  plugins: [
    concat({
      input: ['main.js'],
      files: {'main.js': ['./js/*.js']}
    }),
  ],
});

The plugin doesn't find any js files inside /src/js/ directory (/src/ from root property and /js/ part is in the glob).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant