skeleton-webpack5-plugin
v1.0.4
Published
#### webpack5的骨架屏,基于`html-webpack-plugin`,适用vue react
Downloads
3
Readme
skeleton-webpack5-plugin
webpack5的骨架屏,基于html-webpack-plugin
,适用vue react
使用方法
下载
npm i skeleton-webpack5-plugin
webpack.config.js
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const SkeletonWebpack5Plugin=require('skeleton-webpack5-plugin')
module.exports = {
mode: 'development',
entry: {
app: './src/index.ts',
},
devtool: 'inline-source-map',
devServer: {},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'public/index.html'),
}),
new SkeletonWebpack5Plugin({
url: path.resolve(__dirname, 'src/template.html'),
HtmlWebpackPlugin
})
],
}
src/template.html
<div style="height: 40px;background: #ccc;"></div>
<div style="height: 40px;background: #ccc;margin-top: 10px;"></div>
<div style="height: 40px;background: #ccc;margin-top: 10px;"></div>