0.1.0 • Published 8 years ago
webpack-add-entry v0.1.0
webpack-add-entry
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
License
0.1.0
8 years ago