@halberd/chainedpack
Create Killer API over Webpack configuration
Last updated 2 years ago by raybulgarin .
MIT · Original npm · Tarball · package.json
$ cnpm install @halberd/chainedpack 
SYNC missed versions from official npm registry.
                                                                   
    (       )                         (                         )  
    )\   ( /(     )  (            (   )\ )           )       ( /(  
  (((_)  )\()) ( /(  )\   (      ))\ (()/( `  )   ( /(   (   )\()) 
  )\___ ((_)\  )(_))((_)  )\ )  /((_) ((_))/(/(   )(_))  )\ ((_)\  
 ((/ __|| |(_)((_)_  (_) _(_/( (_))   _| |((_)_\ ((_)_  ((_)| |(_) 
  | (__ | ' \ / _` | | || ' \))/ -_)/ _` || '_ \)/ _` |/ _| | / /  
   \___||_||_|\__,_| |_||_||_| \___|\__,_|| .__/ \__,_|\__| |_\_\  
                                        |_|                      
                                         

Killer API over Webpack Configuration

Chainedpack provides a chainable API over your webpack configuration which lets you do more with your Webpack.

API

addHashImports

Add Short Path for Importing Local Modules

Parameters

  • hashImportsObject Object with different Keys as Hashed Imports

Examples

new Chainedpack
  .addHashImports({ ~Components: './src/components.js' });

Returns Chainedpack returns the Chainedpack with Alias added.

setOutput

Sets the Output path

Parameters

Examples

new Chainedpack
  .setOutput({
    path: path.join(process.cwd(), './build'),
    filename: '[name].js',
    libraryTarget: 'commonjs2',
  });

Returns Chainedpack returns the Chainedpack with Output added.

setEntry

Sets the Entry Point

Parameters

  • entry Object Entry Object for Configuration

Returns Chainedpack with Entry.

setPolyfillEntry

Can be used to tell the entry for polyfilling

Parameters

  • entry Object Entry Object for Polyfilling

Examples

new Chainedpack
  .setPolyfillEntry('main');

Returns Chainedpack with modified configurations. If null is passed polyfill is done to first entry or the entry array if present

extendConfiguration

Can be used to extend the Configuration

Parameters

  • configurationModifier Function Function with Configuration exposed as first Arg

Examples

new Chainedpack
  .extendConfiguration(config => config.entry = ['./src/client.js']);

Returns Chainedpack with modified configurations.

addGlobals

Set Global Variables across the build

Parameters

  • globals Object globals and their values, as keys and values

Examples

new Chainedpack
  .addGlobals({
    __CLIENT__: true
  });

Returns Chainedpack returns the Chainedpack with Globals added.

addPlugins

Add Webpack Plugins to Webpack Configuration

Parameters

Examples

new Chainedpack.addPlugins(new UglifyJsPlugin());

Returns Chainedpack with plugin added.

setEnvironment

Set Environment Vars across the build

Parameters

  • args

checkDuplicatePackages

Show warning in case of duplicate packages

chain

Call the passed Callback fn with Chainedpack instance as the first Argument

Parameters

  • fn

createConfiguration

Used to create Chainedpack Configuration, if you don't have webpack installed Useful for updated webpack plugins and configuration

Parameters

  • createConfigFn Function Function with first arg as Webpack

Examples

Chainedpack.createConfiguration(webpack => configuration(webpack))

Returns Chainedpack configurations.

Current Tags

  • 0.1.7-beta-5.6.3                                ...           latest (2 years ago)

13 Versions

  • 0.1.7-beta-5.6.3                                ...           2 years ago
  • 0.1.7-beta-5.6.0                                ...           2 years ago
  • 0.1.6-beta-5.5.7                                ...           2 years ago
  • 0.1.6-beta-5.5.4                                ...           2 years ago
  • 0.1.6-beta-5.5.3                                ...           2 years ago
  • 0.1.6-beta-5.5.2                                ...           2 years ago
  • 0.1.6-beta-5.5.1                                ...           2 years ago
  • 0.1.6-beta-5.5.0                                ...           2 years ago
  • 0.1.6-beta-5.4.9                                ...           2 years ago
  • 0.1.6-beta-5.4.8                                ...           2 years ago
  • 0.1.6-beta-5.4.7                                ...           2 years ago
  • 0.1.6-beta-5.4.6                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 2
Last Day 0
Last Week 16
Last Month 20
Dependencies (12)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |