Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-static-copy

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-static-copy

rollup-plugin-copy for vite with dev server support.

  • 2.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
358K
increased by6.52%
Maintainers
1
Weekly downloads
 
Created

What is vite-plugin-static-copy?

vite-plugin-static-copy is a Vite plugin that allows you to copy static files or directories to the output directory during the build process. This is useful for including assets that are not part of the module system, such as images, fonts, or other static resources.

What are vite-plugin-static-copy's main functionalities?

Copying Single Files

This feature allows you to copy a single file from the source directory to the destination directory in the output. In this example, 'src/assets/logo.png' is copied to 'assets' in the output directory.

const { defineConfig } = require('vite');
const { viteStaticCopy } = require('vite-plugin-static-copy');

module.exports = defineConfig({
  plugins: [
    viteStaticCopy({
      targets: [
        { src: 'src/assets/logo.png', dest: 'assets' }
      ]
    })
  ]
});

Copying Multiple Files

This feature allows you to copy multiple files using a glob pattern. In this example, all PNG files in 'src/assets' are copied to 'assets' in the output directory.

const { defineConfig } = require('vite');
const { viteStaticCopy } = require('vite-plugin-static-copy');

module.exports = defineConfig({
  plugins: [
    viteStaticCopy({
      targets: [
        { src: 'src/assets/*.png', dest: 'assets' }
      ]
    })
  ]
});

Copying Directories

This feature allows you to copy entire directories. In this example, the 'src/static' directory is copied to 'static' in the output directory.

const { defineConfig } = require('vite');
const { viteStaticCopy } = require('vite-plugin-static-copy');

module.exports = defineConfig({
  plugins: [
    viteStaticCopy({
      targets: [
        { src: 'src/static', dest: 'static' }
      ]
    })
  ]
});

Other packages similar to vite-plugin-static-copy

Keywords

FAQs

Package last updated on 27 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc