React 中复制静态文件到 build的文件夹中
环境:umi 框架
前提:在跟目录下放置了Dockerfile 文件,在build时需要自动复制到dist文件夹里面。
1. 安装 copy-webpack-plugin 插件
2. .umirc.ts 文件中使用copy命令
import { defineConfig } from "umi"; export default defineConfig({ base: "/dict", npmClient: "yarn", tailwindcss: {}, mfsu: false, codeSplitting: { jsStrategy: "granularChunks", jsStrategyOptions: {}, }, plugins: ["@umijs/plugins/dist/tailwindcss"], copy: [ { from: "Dockerfile", to: "dist", }, ], define: {}, });
标签:文件,dist,React,文件夹,build,copy From: https://www.cnblogs.com/1285026182YUAN/p/17807206.html