-
Notifications
You must be signed in to change notification settings - Fork 38
Description
https://webpack.js.org/api/plugins/
https://webpack.js.org/development/how-to-write-a-plugin/
https://webpack.js.org/development/plugin-patterns/
https://github.com/webpack/docs/wiki/how-to-write-a-plugin
https://webpack.js.org/api/plugins/compiler/
https://webpack.js.org/api/plugins/compilation/
https://webpack.js.org/api/parser/
https://github.com/webpack-contrib/worker-loader
https://github.com/webpack/webpack/tree/master/lib/webworker
https://www.youtube.com/watch?v=NHI_PhoykVU
https://github.com/TheLarkInn/everything-is-a-plugin
https://github.com/TheLarkInn/artsy-webpack-tour
https://medium.com/webpack/contributors-guide/home
extract-text-webpack-plugin:
https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/master/src/index.js
https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/master/src/loader.js
Preact async loader:
- https://github.com/developit/preact-cli/blob/master/src/lib/webpack/async-component-loader.js
- https://github.com/developit/preact-cli/blob/master/src/components/async.js
it isn't possible to create new files in loader so there is need to make a plugin if I want to make one worker builder module:
https://webpack.js.org/api/loaders/
webpack/webpack#3311 (comment)
webpack/webpack.js.org#116
Maybe the best solution is to make a plugin that:
- generates a webworkify module once (based on https://github.com/webpack/webpack/blob/master/lib/MainTemplate.js) and adds it as a module (where ? to which chunk ? how can I know to where ?). Maybe this should be done by a loader ? its possible if we still import and call the webworkify-webpack module directly + it can be used as a drop in replacement for webworkify
- for every worker file, generate a wrapper which gets the module dependencies (including dll) of the module, replace the dependency of the original module and this way injects its result into webworkify-webpack.
https://github.com/jamiehill/path-override-webpack-plugin
https://github.com/webpack/webpack/blob/master/lib/NormalModuleFactory.js#L218
https://github.com/webpack/webpack/blob/master/lib/FunctionModuleTemplatePlugin.js
DLL:
https://github.com/webpack/webpack/blob/master/lib/DllReferencePlugin.js
https://github.com/webpack/webpack/blob/master/lib/DelegatedModuleFactoryPlugin.js
https://github.com/webpack/webpack/blob/master/lib/DelegatedModule.js