JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q32145F
  • License MIT

Register global imports on demand for Vite and Webpack

Package Exports

  • unplugin-copy
  • unplugin-copy/esbuild
  • unplugin-copy/nuxt
  • unplugin-copy/rollup
  • unplugin-copy/types
  • unplugin-copy/vite
  • unplugin-copy/webpack

Readme

unplugin-copy

NPM version

copy template for unplugin.

Template Usage

To use this template, clone it down using:

And do a global replace of unplugin-copy with your plugin name.

Then you can start developing your unplugin 🔥

To test your plugin, run: pnpm run dev To release a new version, run: pnpm run release

Install

npm i unplugin-copy
Vite
// vite.config.ts
import copy from 'unplugin-copy/vite'

export default defineConfig({
  plugins: [
    copy({
      src: './node_modules/vue/dist/*',
      dest: 'vue'
    }),
  ],
})

Example: example/


Rollup
// rollup.config.js
import copy from 'unplugin-copy/rollup'

export default {
  plugins: [
    copy({
      src: './node_modules/vue/dist/*',
      dest: 'vue'
    }),
  ],
}


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    copy({
      src: './node_modules/vue/dist/*',
      dest: 'vue'
    }),
  ]
}


Nuxt
// nuxt.config.js
export default {
  buildModules: [
    ['unplugin-copy/nuxt', {
      src: './node_modules/vue/dist/*',
      dest: 'vue'
    }],
  ],
}

This module works for both Nuxt 2 and Nuxt Vite


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-copy/webpack')(
        {
          src: './node_modules/vue/dist/*',
          dest: 'vue'
        },
      ),
    ],
  },
}


esbuild
// esbuild.config.js
import { build } from 'esbuild'
import copy from 'unplugin-copy/esbuild'

build({
  plugins: [
    copy({
      src: './node_modules/vue/dist/*',
      dest: 'vue'
    }),
  ],
})