JSPM

laravel-mix-replace-in-file

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 154
  • Score
    100M100P100Q92927F
  • License GPL-3.0

A simple Laravel Mix extension to allow in-file string replacements.

Package Exports

  • laravel-mix-replace-in-file

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (laravel-mix-replace-in-file) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Laravel Mix Replace In File

Latest Version on NPM npm Software License

This extension allows the replacement of strings in files, essentially exposing the functionality provided by the Replace in file package to Laravel Mix.

Installation

Install the extension as a development dependency:

npm i -D laravel-mix-replace-in-file

Usage

Require the extension and call the stringReplace method. For the full set of options available, please refer to the Replace in file documentation.

const mix = require('laravel-mix');

require( 'laravel-mix-replace-in-file' );

mix.replaceInFile( {
    files: './dist/script.js',
    from: /REPLACE_THIS_STRING/g,
    to: 'with_this_string',
} );