Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-lich-include

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-lich-include

Lich.js dynamic include static resource gulpjs plugin.

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-lich-include

npm version GitHub version MIT Licence Build Status Coverage Status bitHound Dependencies bitHound Dev Dependencies bitHound Code

Lich.js dynamic include static resource gulpjs plugin.

Instructions.

install plugin.

npm i gulp-lich-include -D

In gulpfiles.

let gulp = require('gulp'),
    include = require('gulp-lich-include'),
    // Config File.
    config = require('./Lich.rules.config');

let test = function () {
    let injectObject = {
        env: 'test',
        name: 'dmoo'
    };

    return gulp.src('src/test.html', {base: './src'})
        .pipe(include(config, injectObject))
        .pipe(gulp.dest('./dist'));
};

gulp.task('default', test);

For more examples, see the example folder

Define a config file. Like Lich.rules.config.js

module.exports = {
    // developer directory.
    devDir: path.resolve(__dirname, 'src'),

    // template extension.
    tplExtension: '.swig',

    // javascript extension.
    jsExtension: '.js',

    // css extension.
    cssExtension: '.css',

    // command name.
    command: 'Lich',

    // declare rules.
    rules: {
        commonScripts: [{
            type: 'js-local',
            list: [
                'js/test.rule',
                'js/test1.rule'
            ]
        }, {
            type: 'js-npm',
            list: [
                'jquery/dist/jquery.min'
            ]
        }],
        commonStyles: [{
            type: 'css-local',
            list: [
                'css/test1',
                'css/test2'
            ]
        }, {
            type: 'css-npm',
            list: [
                'animate.css/animate'
            ]
        }]
    }
};

Local javascript include.

<!--Lich js-local="path/to/script"-->
<!--Lich js-local="path/to/script,path/to/other"-->

Local javascript merge.

<!-- Lich js-local-merge="path/to/merge.min:path/to/test1,path/to/test2"-->

Npm javascript include.

<!-- Lich js-npm="path/tp/script"-->
<!-- Lich js-npm="path/to/script,path/to/other"-->

Local style include.

<!--Lich css-local="path/to/style"-->
<!--Lich css-local="path/to/style,path/to/other"-->

Local style merge.

<!--Lich css-local-merge="path/to/merge:path/to/test,path/to/test1"-->

Npm style include.

<!-- Lich css-npm="path/to/style"-->
<!-- Lich css-npm="path/to/style,path/to/other"-->

Template include.

<!--Lich tpl="path/to/tpl"-->

Rule include.

<!--Lich rule="rule"-->

Keywords

FAQs

Package last updated on 05 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc