write-files-dist-webpack-plugin
v1.0.0
Published
write-files-dist-webpack-plugin vue vue.config.js 写文件到dist目录下
Downloads
3
Readme
write-files-dist-webpack-plugin
const writeFile = require('write-file-webpack-plugin');
chainWebpack(config) {
config.plugin('write-files').use(writeFile, [
{
config: { log: true, NODE_ENV: process.env.NODE_ENV },
files: [
{
fileName: 'project_env',
fileType: 'js',
fileContent: `window.project_env_obj = ` + JSON.stringify(fileData)
},
{
fileName: 'hello',
fileType: '/js',
fileContent: `console.log(3333)`
},
{
fileName: 'data',
fileType: 'json',
filePath: '/data',
fileContent: `{"a":1}`
},
{
fileName: 'style',
fileType: 'css',
fileContent: `.main{color:red}`
},
{}
]
}
]);
}
config
files
fileName
fileType :文件类型
filePath : '/data' 使用‘/’分割
fileContent