Skip to content

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

Merged
merged 22 commits into from
May 5, 2017

Conversation

aretecode
Copy link
Contributor

this is #1121

but with examples that are not-yet-merged removed as per #1121 (comment)

🙏 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
Copy link
Contributor Author

aretecode commented May 1, 2017

travis
screen shot 2017-05-01 at 4 38 32 pm

cannot try locally currently
#1179

@simon04 any advice for debugging this?

@skipjack skipjack mentioned this pull request May 2, 2017
@aretecode
Copy link
Contributor Author

screen shot 2017-05-02 at 4 23 56 pm

@skipjack @simon04 should I just take the link out of the index so the build passes or?

@skipjack skipjack requested a review from simon04 May 3, 2017 01:02
@skipjack
Copy link
Collaborator

skipjack commented May 3, 2017

@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.

@skipjack
Copy link
Collaborator

skipjack commented May 3, 2017

@aretecode should we close #1121 now or were you leaving that open as a follow-up PR?

@aretecode
Copy link
Contributor Author

@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.

@aretecode
Copy link
Contributor Author

@skipjack awesome, your fix made the test pass so this pr should be good to go!

Copy link
Collaborator

@simon04 simon04 left a 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.


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]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link is broken.

* `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`)
Copy link
Collaborator

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/.


* `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`
Copy link
Collaborator

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?

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`.
Copy link
Collaborator

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.


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.
Copy link
Collaborator

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.

[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
Copy link
Collaborator

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.




## More
Copy link
Collaborator

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).



```javascript
// webpack.vendor.config.js
Copy link
Collaborator

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).

```

```javascript
// webpack.app.config.js
Copy link
Collaborator

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).

aretecode added 2 commits May 3, 2017 15:24
🙏 skipjack
🔢 prop order
⚒🔗 fix broken link
📒 file names as headers
⎁⎂ more to references
@aretecode
Copy link
Contributor Author

@simon04 updated, thanks for the review!

[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
Copy link
Collaborator

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:

image

This is something I hope to resolve at some point #178, but for now can you inline these?

@skipjack
Copy link
Collaborator

skipjack commented May 5, 2017

@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?

@aretecode
Copy link
Contributor Author

@skipjack thanks, ok, will fix

Copy link
Collaborator

@simon04 simon04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@simon04 simon04 merged commit c471d33 into webpack:master May 5, 2017
@aretecode
Copy link
Contributor Author

🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants