npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

laravel-elixir-config

1.1.2 • Public • Published

laravel-elixir-config Build Status npm

Overrides laravel-elixir configuration from elixir.json or elixir.yml.

Why?

Since laravel-elixir version ^6.0.x, overrides the configuration from elixir.json has been removed. See #648.

  • Set the config in your Gulpfile instead.
  • Write the config with json or yaml format, everything you like.
  • Assign an object

Install

npm install --save-dev laravel-elixir-config

Usage

Update the gulpfile.js.

const elixir = require('laravel-elixir');
 
// ...
require('laravel-elixir-config');

Create elixir.json or elixir.yml file in the project root directory.

Examples

  • elixir.json
{
    "assetsPath": "assets",
    "css": {
        "outputFolder": "assets/css",
        "sass": {
            "pluginOptions": {
                "includePaths": [
                    "node_modules",
                    "bower_components"
                ]
            }
        }
    },
    "js": {
        "outputFolder": "assets/js"
    }
}
  • elixir.yml
assetsPath: assets
css:
    outputFolder: assets/css
    sass:
        pluginOptions:
            includePaths:
                - node_modules
                - bower_components
js:
    outputFolder: assets/js

API

If you want something different or separate your config file, you can use this API.

elixir.configFile(path)

This will be replace the elixir.(json|yml) if it exists from your custom path.

path

  • Type: string
  • Extension: .json, .yml, .yaml

Example

const elixir = require('laravel-elixir');
 
// ...
require('laravel-elixir-config');
 
elixir.configFile('./customFile.json');

Tips

😄 Make happy the gulpfile.js.

const elixir = require('laravel-elixir');
 
require('laravel-elixir-config');
 
elixir((mix) => {
    // copy fonts
    mix.copy(elixir.config.fonts.sourceFolder, elixir.config.fonts.outputFolder);
 
    // copy images
    mix.copy(elixir.config.images.sourceFolder, elixir.config.images.outputFolder);
});
  • elixir.yml
fonts:
    sourceFolder:
        - node_modules/bootstrap-sass/assets/fonts/bootstrap
        - node_modules/font-awesome/fonts
    outputFolder: public/assets/fonts
images:
    sourceFolder: resources/assets/img
    outputFolder: public/assets/img

YAML

Indent style must be space. See the spec YAML version 1.2

Related

Official Documentations

License

MIT @ Guntur Poetra

install

npm i laravel-elixir-config

Downloadsweekly downloads

21

version

1.1.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability