使用CopyWebpackPlugin
插件,在webpack中copy文件或文件夾webpack
$ npm install copy-webpack-plugin --save-dev複製代碼
const CopyWebpackPlugin = require('copy-webpack-plugin');
plugins: [
new CopyWebpackPlugin([
{
from: path.join(__dirname, "../***.txt"),
to: path.join(__dirname, "../dist/***.txt")
}
])
]複製代碼
from 要拷貝的文件路徑web
to 輸出路徑
npm