Code Monkey home page Code Monkey logo

laravel-elixir-replace's Introduction

#Rename Ingredient for Laravel Elixir

This is a simple gulp-batch-replace wrapper ingredient for Laravel Elixir.

Installation

npm install --save-dev laravel-elixir-replace

Usage

Add it to your Elixir-enhanced Gulpfile, like so:

var elixir = require('laravel-elixir');

require('laravel-elixir-replace');

var replacements = [
    ['fonts/', '../fonts/'],
    ['images/', '../images/']
];

elixir(function(mix) {
   mix.replace('public/css/app.css', replacements);
});

This would replace any instance of fonts/ to ../fonts/ and images/ to ../images/ in your public/css/app.css file.

The parameters are replace(file, replacements, output)

output is optional. If not specified, it defaults to the same file as input.

To see what replacements can be, see the gulp-batch-replace docs

Bugs and Contributions

If you find a bug, please post an issue on GitHub describing the problem. Or better yet, make a pull request with the solution.

License

This is open-sourced software licensed under the MIT license

laravel-elixir-replace's People

Contributors

osiux avatar propaganistas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

thijskok

laravel-elixir-replace's Issues

Infinite replace when watching files

Hi! great package, thanks for it! :)

I'm having an issue when i make "gulp watch" with elixir, it just keeps replacing the file the whole time, am i maybe using it wrong or is it actually a bug?

Here's how im using it:

mix
    // Copy html
    .copy('./src/index.html', 'public/index.html')

    // Replace the cache-busting hash
    .replace('public/index.html', [
        ['${HASH}', (new Date()).getTime()]
    ])

of course, i have a new more rules but these two are the significant one.

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.