Feature request: To expand output.libraryTarget

Webpack version:
1.10.x/2.x

Please tell us about your environment:
OSX 10.x / Linux / Windows 10

Current behavior:
If I need to add a new libraryTarget, such as seajs module。
I need to cover LibraryTemplatePlugin and ExternalModule.
Because of these two methods are used in a switch statement.

Expected/desired behavior:
I think here should use hooks instead of the switch.

Can I submit a PR?

Author: Fantashit

1 thought on “Feature request: To expand output.libraryTarget

  1. @sokra

    example:

    AMD(requirejs):

    define('xxx/a.js' /*id?*/,  ['./b.js', './c.js'] /*dependencies*/, function(b, c) {
      //..
      return a;
    });

    seajs Module:

    define('xxx/a.js' /*id?*/,  ['./b.js', './c.js'] /*dependencies?*/, function(require, exports, module) {
      var b = require('./b.js');
      var c = require('./c.js');
    
      // ...
    
      module.exports = a;
    });

    so I wrote a plugin solve it seajs-webpack-plugin.The method is to cover LibraryTemplatePlugin and ExternalModule.

    I think the source code should use hooks, more conducive to extend.

Comments are closed.