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

@shimo/gulp-build

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shimo/gulp-build

Compress your backend codes.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@shimo/gulp-build

Compress your backend codes in private-deploy-env.

Getting Started

$ npm install --save-dev @shimo/gulp-build

Usage

The plug-in takes a option and process the current folder codes to a sub-dir for private-deploy.

const gulp = require('gulp');
const gulpBuild = require('@shimo/gulp-build');

gulp.task('private-deploy', () => gulpBuild({
  dest: './release'
});

Options

dest

The destination dir you want to generate to, like ./release.

copyResources

The resource files you want to copy to dest without any change.

gulpBuild({
  // dest, ...
  copyResources: [
    './config/default.toml',
    './config/test.toml',
    './database/migrations/*',
    './test/**'
  ]
})

entries

The files you want to webpack.

gulpBuild({
  // dest, ...
  entries: [
    './server.js',
    './bin/migrate.js'
  ]
})

nodeModuleFilter

This is a function which can exclude some modules to the dest dir. you may not want to webpack some modules in node_modules dir which is in your own private npm registery. using this function you can do this.

gulpBuild({
  // dest, ...
  nodeModuleFilter (x) {
    return x.indexOf('shimo') === -1 &&
      x.indexOf('richdoc') === -1
  }
})

modifyPkg

The function can modify the package.json in the dest dir. some modules is useless in clients' server and it may occur error if you not modify the package.json.

gulpBuild({
  // dest, ...
  modifyPkg (pkg) {
    ['dependencies', 'devDependencies'].forEach(bigKey => {
      Object.keys(pkg[bigKey]).forEach(key => {
        if (key.indexOf('shimo') > -1) {
          delete pkg[bigKey][key]
        }
      })
    })

    delete pkg.scripts.preinstall
    delete pkg.scripts.install
    return pkg
  }
})

License

MIT

FAQs

Package last updated on 31 May 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