0.1.0 • Published 8 years ago

webpack-add-entry v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

webpack-add-entry

NPM version NPM downloads Build Status

Install

$ npm install --save webpack-add-entry

Usage

const addEntry = require('webpack-add-entry')

const webpackConfig = {entry: './entry.js'}
webpack.entry = addEntry(webpack.entry, './new-entry.js')
//=> entry: ['./entry.js', './new-entry.js']

API

webpackAddEntry(entry, newEntry, options)

Returns the new entry without mutating the old one.

entry

Type: string array object Required: true

Webpack entry.

newEntry

Type: string Required: true

New webpack entry to add.

options

One of key and to is required.

key

Type: string

Add a new chunk entry, eg:

addEntry({client: './client.js'}, './server.js', {key: 'server'})
/*
{
  client: './client.js',
  server: './server.js'
}
*/
to

Type: string

Add to a chunk entry, eg:

addEntry({client: './client.js', './server.js', {to: 'client'}})
/*
{
  client: ['./client.js', './server.js']
}
*/

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © EGOIST