webpack-assets-upload
v1.0.6
Published
const { AssetsUploadPlugin } = require('webpack-assets-upload/dist/plugin');
Downloads
6
Readme
useage
const { AssetsUploadPlugin } = require('webpack-assets-upload/dist/plugin');
// plugin
new AssetsUploadPlugin({ outputFile: "ossMap.json" })
// loader
module.exports = {
module: {
rules: [
{
test: /\.(png|jpe?g|gif)$/i,
use: [
{
loader: "webpack-assets-upload",
options: {
mapJson: path.resolve(__dirname, "../ossMap.json"),
upload: () => {
return Promise.resolve("https://www.baidu.com");
},
},
},
],
},
],
},
};