Skip to content

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

License

Notifications You must be signed in to change notification settings

andreg/laravel-mix-replace-in-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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',
} );

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published