Ninja Pumpkin Mutants

    laravel-mix-string-replace

    0.1.0 • Public • Published

    Laravel Mix String Replace

    Latest Version on NPM npm Software License

    This extension adds support for string-replace-loader to Laravel Mix.

    Installation

    npm i -D laravel-mix-string-replace
    

    Usage

    Require the extension inside your webpack.mix.js and add string replace configurations like this:

    const mix = require('laravel-mix');
     
    require('laravel-mix-string-replace');
     
    mix
      .sass('src/styles/_style.scss', 'style.css')
     
      // replace the text "GIT_VERSION" with text provided by the function getVersionTag
      .stringReplace({
        test: /_style\.scss$/,
        loader: 'string-replace-loader',
        options: {
          search: 'GIT_VERSION',
          replace: getVersionTag,
        }
      })

    Note that this plugin is likely to change to clean up the interface before it reaches version 1.0.0.

    For more information about string-replace-loader configurations please refer to their documentation.

    Install

    npm i laravel-mix-string-replace

    DownloadsWeekly Downloads

    224

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    3.83 kB

    Total Files

    4

    Last publish

    Collaborators

    • oppiansteve