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

packer-cli

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

packer-cli

Full-fledged CLI tool to generate library node module modules compliant with Browser and NodeJS with vanilla JS and Typescript source support.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Packer CLI

Full-fledged CLI tool to package library node module modules compliant with Browser and NodeJS with vanilla JS and Typescript source support.

Build Status MIT

Features

  • Managed build config
  • NPM
  • Yarn
  • Travis
  • Typescript 2.x
  • Babel 7.x
  • TS Lint code analysis
  • Precompiled handlebars templating
  • Post CSS based image inline and auto prefixing
  • Styling using SCSS
  • SCSS Lint
  • Karma
  • Jasmine
  • Rollup and Gulp based build process
  • FESM5, FESM2015 and UMD build output
  • Emmit type definitions
  • Ready to publish as Node module
  • Inline and bundle style
  • Theme packaging
  • Import path replace
  • Exclude external peer dependencies
  • Bundle peer dependencies
  • Ignore imports
  • Copy static assets to build dir

Usage

You can simply run the following command in preferred directory to generate a new project using Packer CLI,

npx packer-cli generate my-library

or

npm install packer-cli -g && packer new my-library

Once project is generated and dependencies are installed, you can use the following CLI commands:

# Run project on watch mode
npm run watch

# Production build
npm run build

# Run unit test suite on development envrionemnt watch mode
npm run test

# Run unit test suite on continues integration environment mode
npm run test:ci

Build Configuration

{
  "namespace": "ts.lib",
  "entry": "index.ts",
  "source": "src/ts",
  "out": "dist",
  "tsProject": true,
  "watch": {
    "script": ".tmp",
    "demo": "demo/watch",
    "port": 4000,
    "open": true
  },
  "copy": [
    "README.md",
    "LICENSE"
  ],
  "flatGlobals": {},
  "esmExternals": [
    "handlebars/runtime"
  ],
  "pathReplacePatterns": [
    {
      "test": "./conf/conf1",
      "replace": "./conf/conf2"
    }
  ],
  "ignore": [],
  "imageInlineLimit": 1000000,
  "assetPaths": [
    "src/assets"
  ],
  "bundleStyle": false,
  "bundleFormat": "umd"
}
ConfigTypeDefinition
namespacestringapplication namespace to be used
entrystringentry typescript file
sourcestringsource directory
outstringbuild output directory
tsProjectbooleanSet true if library source is in Typescript
watchobjectwatch mode configuration object
watch.scriptstringwatch build temp directory
watch.demostringwatch demo page dir
watch.portnumberwatch server port
watch.openbooleanopen browser automatically
copyarray of stringsList of files paths to copy on build.
flatGlobalsobjectflat bundle build global dependencies. Listed will not be treated as externals.
esmExternalsESM build external dependencies
pathReplacePatternsarray of objectsImport path replace pattern collection
pathReplacePatterns.teststringPath to find
pathReplacePatterns.replacestringPath to replace
ignorearray of stringsImport paths to ignore with noop implementation
imageInlineLimitnumberInline image if image size is less than specified limit
assetPathsarray of stringsList of paths which contains static assets referenced in style sheets
bundleStylebooleanInline bundle styles to build
bundleFormatstringumd, amd, iife, system, es, cjs

Contributions

Feel free to open an issue or create a PR

Keywords

FAQs

Package last updated on 20 Sep 2018

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