1.0.4 • Published 2 years ago

skeleton-webpack5-plugin v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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>
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago