remove webpack comments from build (for yuidoc)#377
Merged
therewasaguy merged 2 commits intomasterfrom Sep 4, 2019
Merged
Conversation
46650d1 to
aa2ec4e
Compare
Member
Author
|
Update: We can just remove the comments that webpack adds, but keep the JSDoc comments, with help from https://www.npmjs.com/package/decomment and some regex |
This lib/docs/p5.sound.comments.js file will be used to generate documentation in the p5.js repo as part of that project's yuidoc config. That config will need to ignore the p5.sound file comments, because those now have a bunch of webpack comments that confuse yuidoc parser. Those comments have been removed from the .comments.js file
These extra comments that webpack add interfere with the build
aa2ec4e to
11a1602
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
p5 generates p5.sound documentation by looking at the p5.sound.js file in the addons directory here.
Unfortunately, our new webpack build adds comments that confuse the yuidoc parser.
@oshoham and I spent some time looking at possible solutions. We tried to remove extraneous comments from the webpack build, but this caused more problems.
The solution we came to for now is to separate out the comments using the "extractComments" options, which is designed to extract a license file. We'll include this file with updates to the p5 repo. Then p5 will pick up the comments from that file when it generates the reference pages.
We'd need to either remove comments from the un-minified file, or change this to point to a documentation directory that only has this documentation file.