npm.io
1.0.11 • Published 3 years ago

vite-check-path-exists

Licence
ISC
Version
1.0.11
Deps
0
Size
3 kB
Vulns
0
Weekly
0

vite-check-path-exists

vite-check-path-exists - this is a plugin for Vite bundler that detects the presence of files and folders referenced by HTML code. If the file or folder does not exist, the application displays a warning about the missing file or folder.

Installation

Install the package as a development dependency:

npm i -D vite-check-path-exists # yarn add -D vite-check-path-exists

Usage

Add it to your plugins in vite.config.ts

import { defineConfig } from "vite";
import checkPathExists from "vite-check-path-exists";

export default defineConfig({
    plugins: [checkPathExists()],
});

Configuration

The following options can be provided:

  • rootDir

    Files will be check against this directory.

    Default: src

    checkPathExists({ rootDir: "someDir" }),
  • publicDir

    Public files will be check against this directory.

    Default: public

    checkPathExists({ publicDir: "someDir" });

Keywords