html-webpack-blade-plugin

0.2.2 • Public • Published

Blade extension for HTML Webpack Plugin

This plugin mutates the HTML file after it's been generated. Useful in situations like using vue-cli.

Installation

npm install --save-dev html-webpack-blade-plugin

Usage

plugins: [
  new HtmlWebpackBladePlugin()
]

By default <html> will be replaced with @extends('html'), <head> with @section('scripts') and <body> with @section('content'). These defaults can be overridden:

plugins: [
  new HtmlWebpackBladePlugin({
    extends: 'my.layout.template',
    scripts: 'myScriptYield',
    content: 'myContentYield',
  })
]

Production & Minification

The mutation will only be performed in production environments. You can still serve an HTML file as you normally would in development.

Since Blade is server-side template code (and will be processed by the Blade compiler), HTML minification should be disabled. There's no benifit to minifying a template, and it may break Blade.

License

This package is licensed under the MIT license. Do as you wish.

/html-webpack-blade-plugin/

    Package Sidebar

    Install

    npm i html-webpack-blade-plugin

    Weekly Downloads

    2

    Version

    0.2.2

    License

    MIT

    Unpacked Size

    5.07 kB

    Total Files

    7

    Last publish

    Collaborators

    • danielsdeboer