How to use the html-inline-css-webpack-plugin function in html-inline-css-webpack-plugin

To help you get started, we’ve selected a few html-inline-css-webpack-plugin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feflow / builder-webpack4 / src / builder.ts View on Github external
? {
                            html5: true,
                            collapseWhitespace: true,
                            preserveLineBreaks: false,
                            minifyCSS: true,
                            minifyJS: true,
                            removeComments: false
                        }
                        : false
                }));

                // Inline 生成出来的css
                if (_inlineCSS) {
                    let pageName = path.normalize(entry).split(path.sep).pop();
                    if (pageName) {
                        cssInlinePlugins.push(new HTMLInlineCSSWebpackPlugin({
                            filter(fileName) {
                                let cssFileName = fileName;
                                if (/\.css$/.test(fileName)) {
                                    // file的hash默认是8个,如果另外定义数量请注意修改这里的截取位置(MiniCssExtractPlugin中)
                                    cssFileName = fileName.slice(0, fileName.length - 13);
                                }
                                return (pageName === cssFileName) || new RegExp(`${pageName}\.html$`).test(fileName);
                            }
                        }));
                    }
                }
            });

html-inline-css-webpack-plugin

☄️ A webpack plugin for convert external stylesheet to embedded stylesheet, aka document stylesheet

MIT
Latest version published 10 months ago

Package Health Score

61 / 100
Full package analysis

Popular html-inline-css-webpack-plugin functions