1.0.7 • Published 8 years ago

webpack-modificators v1.0.7

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

webpack-modificators

Build Status

NPM

This WebPack plugin allows to replace modules by modificator name.

Install

npm install webpack-modificators --save-dev

Usage

Add this plugin into your webpack config:

var WebpackModificators = require('webpack-modificators');

module.exports = {
  entry: { },
  output: { },
  plugins: [new WebpackModificators({strong: ['new']})]
};

WebpackModificators gets one argument: modificator name.

Webpack will try require dependency with name {dependency-name}--{modification-name} instead of {dependency-name}. If it's not possible webpack will use {dependency-name}.

Common case of this plugin: build the same entry point but with slightly different dependencies. To do it you may use list of webpack configs:

var WebpackModificators = require('webpack-modificators');

module.exports = [{
  entry: { entry1: 'file.js' },
  output: { }
}, {
  entry: { entry2: 'file.js' },
  output: { },
  plugins: [new WebpackModificators({strong: ['new']})]
}];

Development

Build an example:

npm run build_example

Run jshint and tests:

npm test

Run tests in Docker (node 0.10):

docker-compose run --rm test
1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago