webpack-custom-var-library-name-plugin

A WebPack ~~hack~~ plugin to allow to set a different module name to the var `libraryTarget` and the AMD/CommonJS when using `libraryTarget:'umd'`.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
webpack-custom-var-library-name-plugin
1.0.27 years ago8 years agoMinified + gzip package size for webpack-custom-var-library-name-plugin in KB

Readme

CustomVarLibraryNamePlugin
A WebPack hack plugin to allow to set a different module name to the var libraryTarget and the AMD/CommonJS when using libraryTarget:'umd'.
The latest relase adds the hability to change the file name and handle multiple bundle names.

Install

$ npm i --save-dev webpack-custom-var-library-name-plugin

Usage

var CustomVarLibraryNamePlugin = require('webpack-custom-var-library-name-plugin');

    plugins: [
        ...
        new CustomVarLibraryNamePlugin({
          name: 'var-name'
        }),
        ...
    ],
...

var CustomVarLibraryNamePlugin = require('webpack-custom-var-library-name-plugin');

    plugins: [
        ...
        new CustomVarLibraryNamePlugin({
          name: {
            'chunk-name': {
                var: 'var-name',
                file: 'file-name'
            }
          }
        }),
        ...
    ],
...