copy-running-files-plugin

new CopyRunningFilesPlugin({ splitFrom: path.resolve(__dirname), // 必传 package.json所在的文件夹目录 target: path.resolve(__dirname, "../target") // 必传 target为抽离文件放置的目录 })

Usage no npm install needed!

<script type="module">
  import copyRunningFilesPlugin from 'https://cdn.skypack.dev/copy-running-files-plugin';
</script>

README

CopyRunningFilesPlugin

用于将多个糅合在一起的项目进行抽离

原理: 记录 webpack 打包时运行的文件, 然后进行拷贝

使用方法

 new CopyRunningFilesPlugin({
      splitFrom: path.resolve(__dirname),  // 必传 package.json所在的文件夹目录
      target: path.resolve(__dirname, "../target") // 必传   target为抽离文件放置的目录
 })