Wondering what’s next for npm?Check out our public roadmap! »

    html-webpack-dotnet-versionize-plugin

    1.0.1 • Public • Published

    Html Webpack Dotnet Versionize Plugin

    A plugin for webpack-html-plugin to add .net framework's ToVersionizeSC() method to the scripts and styles

    Useful when you create .cshtml file instead of .html file with html-webpack-plugin.

    Configuration

    1. Install via npm i -D html-webpack-dotnet-versionize-plugin or yarn add -D html-webpack-dotnet-versionize-plugin
    2. Add to your webpack config AFTER HtmlWebpackPlugin
        const HtmlWebpackDotnetVersionizePlugin = require('html-webpack-dotnet-versionize-plugin');
     
        ...
        plugins: [
            new HtmlWebpackPlugin({
                filename: path.join(__dirname, 'Sample/Path/Views/Account/MyAccount.cshtml'),
                template: path.join(__dirname, 'Sample/Path/Templates/MyAccount.ejs'),
                minify: false,
            }),
            new HtmlWebpackDotnetVersionizePlugin()
        ]

    Sample Output

    <html>
      <head>
        <meta charset="utf-8">
        <title>Webpack App</title>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <link href="@("/css/main.css".ToVersionizeSC())" rel="stylesheet"/>
      </head>
      <body>
      <script src="@("/js/main.js".ToVersionizeSC())"></script></body>
    </html>

    Testing

    I'm planning to write test in future. Currently you can test the plugin manually. Install npm packages then run npm run test:build. You can see result in test/index.html file.

    Install

    npm i html-webpack-dotnet-versionize-plugin

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    5.99 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar