html-webpack-basepath-plugin

0.0.6 • Public • Published

Html Webpack Basepath Plugin

Plugin for simple enhancement html webpack plugin for make possibility to define basePath option. basePath option will overwrite the path for all the JS and CSS files injected by webpack-html-plugin into html file.

  npm i --save-dev html-webpack-basepath-plugin
  yarn add --dev html-webpack-basepath-plugin

Plugin solves problem with JS/CSS basePath on any templating systems, like on following example:

new HtmlWebpackPlugin({
    filename: ROOT_PATH + '/app/presenters/templates/@layout.latte',
    template: ROOT_PATH + '/app/assets/@layout.latte',
    basePath: '{$basePath}/dist/'
 }),

...it will inject into HTML:

<script src="{$basePath}/dist/app.js" ...

...and {$basePath} will be replaced by the base url path by the templating engine.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i html-webpack-basepath-plugin

    Weekly Downloads

    0

    Version

    0.0.6

    License

    ISC

    Unpacked Size

    4.53 kB

    Total Files

    4

    Last publish

    Collaborators

    • acqsk