-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
DllPlugin & DllReferencePlugin docs (without pending examples) #1177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🙏 add simon04 to collaborators 🛁 clean commented example 🔗🌽 link to example pull request 🔗 add more named links to other parts of the dll plugin & dll reference plugin source code 🌊👣 add TemplatePaths type for `name` 🔬 more source code test links 📘 add examples section 📘⎁⎂ descriptions for the examples, explain what functionality they demonstrate
🏛️ update structure as suggested by @simon04 [here](webpack#1121 (comment)) ⚒⌨️ fix typo found by @smashercosmo webpack#1121 (review) 📘 added dll-example using `libraryTarget` + `sourceType` `"commonjs2"` to create a vendor bundle, and a dependency bundle, on nodejs. 📝 remove completed todos
@aretecode patched that issue in #1170. We still have to figure out the root cause but this should be fine for review and merging as that issue obviously wasn't caused by this PR. |
@aretecode should we close #1121 now or were you leaving that open as a follow-up PR? |
@skipjack I'd like to have it as a follow-up pr because there are still 2 examples I made for webpack that I'd like merged, which that pr references. |
@skipjack awesome, your fix made the test pass so this pr should be good to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Wow, I like the way this plugin documentation is written. Thanks a lot for your efforts.
I found a few rather minor issues. Please revise.
content/plugins/dll-plugin.md
Outdated
|
||
Because this happens after resolving every file in the dll bundle, the same paths must be available for the consumer of the dll bundle. i.e. if the dll contains `lodash` and the file `abc`, `require("lodash")` and `require("./abc")` will be used from the dll, rather than building them into the main bundle. | ||
|
||
T> [See an example use of mapped mode][examples-dll-source-type-and-dependencies] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is broken.
content/plugins/dll-plugin.md
Outdated
* `context`: (**absolute path**) context of requests in the manifest (or content property) | ||
* `content` (optional): the mappings from request to module id (defaults to `manifest.content`) | ||
* `manifest` (object): an object containing `content` and `name` | ||
* `name` (optional): the name where the dll is exposed (defaults to `manifest.name`) (see also `externals`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link *externals to /configuration/externals/
.
content/plugins/dll-plugin.md
Outdated
|
||
* `context`: (**absolute path**) context of requests in the manifest (or content property) | ||
* `content` (optional): the mappings from request to module id (defaults to `manifest.content`) | ||
* `manifest` (object): an object containing `content` and `name` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the alphabetical ordering. Still, since content
refers to manifest
, put manifest
before content
?
content/plugins/dll-plugin.md
Outdated
Creates a `manifest.json` which is written to the given `path`. It contains mappings from require and import requests, to module ids. It is used by the [DllReferencePlugin](#DllReferencePlugin). | ||
|
||
|
||
W> Keep the `name` consistent with `output.library`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this warning below the next paragraph since the latter explains what this is good for.
content/plugins/dll-plugin.md
Outdated
|
||
W> Keep the `name` consistent with `output.library`. | ||
|
||
Combine this plugin with `output.library` option to expose (aka, put into the global scope) the dll function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link output.library
to /concepts/output/#output-library
.
content/plugins/dll-plugin.md
Outdated
[tests-DllPlugin-1]: https://github.com/webpack/webpack/tree/master/test/configCases/dll-plugin | ||
[tests-DllPlugin-2]: https://github.com/webpack/webpack/tree/master/test/configCases/dll-plugin/2-use-dll-without-scope/webpack.config.js | ||
|
||
[docs-libraryTarget]: https://webpack.js.org/configuration/output/#output-librarytarget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop the https://webpack.js.org
part from the link.
content/plugins/dll-plugin.md
Outdated
|
||
|
||
|
||
## More |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace "More" with "References" (to conform with other documentation pages).
content/plugins/dll-plugin.md
Outdated
|
||
|
||
```javascript | ||
// webpack.vendor.config.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the filename above the code block in bold letters: **webpack.vendor.config.js**
(to comply with other pages).
content/plugins/dll-plugin.md
Outdated
``` | ||
|
||
```javascript | ||
// webpack.app.config.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the filename above the code block in bold letters: **webpack.app.config.js**
(to comply with other pages).
🙏 skipjack 🔢 prop order ⚒🔗 fix broken link 📒 file names as headers ⎁⎂ more to references
@simon04 updated, thanks for the review! |
content/plugins/dll-plugin.md
Outdated
[examples-dll-user]: https://github.com/webpack/webpack/tree/master/examples/dll-user | ||
[examples-explicit-vendor-chunk]: https://github.com/webpack/webpack/tree/master/examples/explicit-vendor-chunk/README.md | ||
|
||
[src-DllReferencePlugin]: https://github.com/webpack/tree/master/lib/DllReferencePlugin.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aretecode unfortunately our current setup doesn't support reference links:
This is something I hope to resolve at some point #178, but for now can you inline these?
@aretecode after that reference link fix this should be good to go in my view. Improvements can always be made in follow-up PRs, @simon04 what do you think? |
@skipjack thanks, ok, will fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
🎊 |
this is #1121
but with examples that are not-yet-merged removed as per #1121 (comment)