inline-code-webpack-plugin

0.0.3 • Public • Published

inline-code-webpack-plugin

webpack插件,支持将打包结果或者自定义js、css内联插入到html中。

entry: {
        bundle: [''],
        inlinejs: [''],
        skeleton: ['']
},
plugins: [
    new htmlWebpackPlugin({
        template: './index.html',
        chunks: ['bundle'],
        inject: false,
        minify: false
    }),
    new InlineCodeWebpackPlugin({
        // 插入打包后的代码
        headTags: ['skeleton'], 
        bodyTags: ['inlinejs', {
            tagName: 'script',
            innerHTML: 'var a= 1;', // 注入自定义脚本
            attributes: {
                href: '',
                src: ''
            }
        }]
    }),
]

Package Sidebar

Install

npm i inline-code-webpack-plugin

Weekly Downloads

1

Version

0.0.3

License

ISC

Unpacked Size

3.65 kB

Total Files

3

Last publish

Collaborators

  • huazihear