shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 184 forks source link

Require webpack-manifest-plugin through webpack-load-plugins #40

Closed Teun87 closed 7 years ago

Teun87 commented 7 years ago

Hi,

I can't (lazy) load the plugin through 'webpack-load-plugins', while 'extract-text-webpack-plugin' does work. What am I doing wrong? This way I do not need to require everything seperately.

var webpackLoadPlugins = require('webpack-load-plugins');
var plugins = webpackLoadPlugins();

webpackLoadPlugins({
    rename: {
        'webpack-manifest-plugin': 'jsonManifest',
        'extract-text-webpack-plugin': 'extractText'
    }
});

... use: plugins.extractText.extract({}); // does work

... new plugins.jsonManifest // does not work, console.log does return 'undefined'

package.json

...{
  "dependencies": {
    "babel-core": "^6.24.1",
    "babel-loader": "^7.0.0",
    "babel-preset-es2015": "^6.24.1",
    "css-loader": "^0.28.1",
    "extract-text-webpack-plugin": "^2.1.0",
    "path": "^0.12.7",
    "style-loader": "^0.17.0",
    "vue": "^2.3.3",
    "webpack": "^2.5.1",
    "webpack-load-plugins": "^0.1.2",
    "webpack-merge": "^4.1.0",
    "webpack-manifest-plugin": "^1.1.0"
  }...

}

mastilver commented 7 years ago

Do:

var plugins = webpackLoadPlugins({
    rename: {
        'webpack-manifest-plugin': 'jsonManifest',
        'extract-text-webpack-plugin': 'extractText'
    }
});