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

gulp-assign

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-assign

Detects JavaScript/CSS references in HTML and assigns to others plugins

  • 1.0.0-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

gulp-assign

Installation

npm i -D gulp-assign

Usage

└── src/
    ├── css/
    │   ├── lib/
    │   │   ├── a.css
    │   │   └── b.css
    │   ├── a.css
    │   └── b.css
    ├── js/
    │   ├── lib/
    │   │   ├── a.js
    │   │   └── b.js
    │   ├── a.js
    │   └── b.js
    └── index.html
<!-- build:css /css/main.css -->
  <link rel="stylesheet" href="css/a.css" />
  <link rel="stylesheet" href="css/b.css" />
<!-- endbuild -->

<!-- build:js:lib ./js/main.lib.js -->
  <script src="js/lib/a.js"></script>
  <script src="js/lib/b.js"></script>
<!-- endbuild -->
<!-- build:js ./js/main.js -->
  <script src="js/a.js"></script>
  <script src="js/b.js"></script>
<!-- endbuild -->
var assign = require('gulp-assign');

var streamAssignee = function(inputs, output) {
  return gulp.src(inputs, {base: 'src'})
    .pipe(concat(output.relative))
    .pipe(gulp.dest('dist'));
};

var callbackAssignee = function(inputs, output, callback) {
  gulp.src(inputs, {base: 'src'})
    .pipe(concat(output.relative))
    .pipe(gulp.dest('dist'))
    .on('error', callback)
    .on('end', callback);
};

var assignees = {
  css: streamAssignee,
  js: {
    default: streamAssignee,
    lib: callbackAssignee
  }
};

gulp.task('pack', function() {
  return gulp.src('src/**/*.html')
    .pipe(assign(assignees))
    .pipe(gulp.dest('dist'));
});

Results

└── dist/
    ├── css/
    │   └── main.css
    ├── js/
    │   ├── main.js
    │   └── main.lib.js
    └── index.html
<link rel="stylesheet" href="/css/main.css" />

<script src="./js/main.lib.js"></script>
<script src="./js/main.js"></script>

Keywords

FAQs

Package last updated on 21 Nov 2015

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