hard-source-webpack-plugin icon indicating copy to clipboard operation
hard-source-webpack-plugin copied to clipboard

Support first party plugins and loaders

Open mzgoddard opened this issue 7 years ago • 5 comments

Support all plugins and loaders under https://github.com/webpack. Support can be not caching but making sure builds are correct and complete or fail as expected.

  • * Resolution to this module is cached (in addition to modules depending on this being cached)
  • ** Modules depending on this are cached

Under https://github.com/webpack/webpack

  • [x] ContextModule
  • [x] DllPlugin
  • [x] DllReferencePlugin
  • [x] DelegatedModule *
  • [x] ExternalPlugin
  • [x] ExternalModule **
  • [ ] RawModule
  • [ ] CommonsChunkPlugin
  • [ ] DedupePlugin
  • [x] UglifyJsPlugin
  • [x] HotModuleReplacementPlugin
  • [x] IgnorePlugin (Fix: #92, Related: #91, https://github.com/mzgoddard/hard-source-webpack-plugin/issues/72#issuecomment-276077740)
  • [ ] NamedModulesPlugin
  • [ ] HashedModuleIdsPlugin

Under https://github.com/webpack-contrib

  • [x] extract-text-webpack-plugin *
  • [x] mini-css-extract-plugin
  • [ ] style-loader
  • [x] css-loader
  • [ ] mocha-loader
  • [ ] null-loader
  • [ ] imports-loader
  • [ ] json-loader
  • [ ] url-loader
  • [x] file-loader
  • [ ] raw-loader
  • [ ] less-loader
  • [ ] exports-loader
  • [ ] html-loader
  • [ ] coffee-loader
  • [ ] expose-loader
  • [ ] json5-loader
  • [ ] transform-loader
  • [ ] coffee-redux-loader
  • [ ] bundle-loader
  • [ ] script-loader
  • [ ] jshint-loader
  • [ ] i18n-webpack-plugin
  • [ ] compression-webpack-plugin
  • [ ] coverjs-loader
  • [ ] multi-loader
  • [ ] i18n-loader
  • [ ] source-map-loader
  • [x] worker-loader

mzgoddard avatar Dec 08 '16 23:12 mzgoddard

Ah, I was planning on opening an issue to say that CommonsChunkPlugin caused problems w/ HSWP, but it seems this is known. This is unfortunate as it's an important part of optimizing our build. Thanks for HSWP though, it's saved us a ton of time during dev.

aaronjensen avatar Jan 16 '17 01:01 aaronjensen

I'm having issues while using this plugin with webpack.IgnorePlugin, here's my config:

new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),

and here's the error I get:

/Users/adrien/Projects/tray/website/node_modules/hard-source-webpack-plugin/lib/hard-context-module-factory.js:74
    var identifier = identifierPrefix + module.identifier();
                                              ^

TypeError: Cannot read property 'identifier' of undefined
    at /Users/adrien/Projects/tray/website/node_modules/hard-source-webpack-plugin/lib/hard-context-module-factory.js:74:47
    at /Users/adrien/Projects/tray/website/node_modules/webpack/lib/ContextModuleFactory.js:37:22
    at /Users/adrien/Projects/tray/website/node_modules/tapable/lib/Tapable.js:204:11
    at ContextModuleFactory.cmf.plugin (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/IgnorePlugin.js:28:24)
    at /Users/adrien/Projects/tray/website/node_modules/tapable/lib/Tapable.js:206:14
    at ContextModuleFactory.cmf.plugin (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/IgnorePlugin.js:30:13)
    at ContextModuleFactory.applyPluginsAsyncWaterfall (/Users/adrien/Projects/tray/website/node_modules/tapable/lib/Tapable.js:208:13)
    at ContextModuleFactory.create (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/ContextModuleFactory.js:26:7)
    at next (/Users/adrien/Projects/tray/website/node_modules/hard-source-webpack-plugin/lib/hard-context-module-factory.js:59:15)
    at HardContextModuleFactory.create (/Users/adrien/Projects/tray/website/node_modules/hard-source-webpack-plugin/lib/hard-context-module-factory.js:66:3)
    at iteratorFactory (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:209:12)
    at /Users/adrien/Projects/tray/website/node_modules/webpack/node_modules/async/dist/async.js:3025:16
    at eachOfArrayLike (/Users/adrien/Projects/tray/website/node_modules/webpack/node_modules/async/dist/async.js:941:9)
    at eachOf (/Users/adrien/Projects/tray/website/node_modules/webpack/node_modules/async/dist/async.js:991:5)
    at Object.eachLimit (/Users/adrien/Projects/tray/website/node_modules/webpack/node_modules/async/dist/async.js:3089:3)
    at Compilation.addModuleDependencies (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:190:9)
    at Compilation.processModuleDependencies (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:175:8)
    at _this.buildModule.err (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:315:13)
    at building.forEach.cb (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:125:27)
    at Array.forEach (native)
    at callback (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:125:13)
    at module.build (/Users/adrien/Projects/tray/website/node_modules/webpack/lib/Compilation.js:147:11)
    at /Users/adrien/Projects/tray/website/node_modules/webpack/lib/NormalModule.js:210:10
    at /Users/adrien/Projects/tray/website/node_modules/webpack/lib/NormalModule.js:162:10
    at /Users/adrien/Projects/tray/website/node_modules/loader-runner/lib/LoaderRunner.js:370:3
    at iterateNormalLoaders (/Users/adrien/Projects/tray/website/node_modules/loader-runner/lib/LoaderRunner.js:211:10)
    at Array.<anonymous> (/Users/adrien/Projects/tray/website/node_modules/loader-runner/lib/LoaderRunner.js:202:4)
    at Storage.finished (/Users/adrien/Projects/tray/website/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:15)
    at /Users/adrien/Projects/tray/website/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:69:9
    at /Users/adrien/Projects/tray/website/node_modules/graceful-fs/graceful-fs.js:78:16

if I remove the IgnorePlugin, it works.

adriantoine avatar Jan 30 '17 14:01 adriantoine

Thank you @adriantoine and @legomushroom for your debug info for IgnorePlugin. Let me know if 0.3.9 does or doesn't work for you.

mzgoddard avatar Jan 31 '17 18:01 mzgoddard

Ooop. 0.3.9 will be up in a bit. I left out a bit of code in my last merge.

mzgoddard avatar Jan 31 '17 18:01 mzgoddard

Hey @mzgoddard, sorry I didn't answer earlier (I couldn't test), it's fixed in v0.3.9, thanks for your works!

adriantoine avatar Feb 07 '17 10:02 adriantoine