Skip to content

Comments

remove webpack comments from build (for yuidoc)#377

Merged
therewasaguy merged 2 commits intomasterfrom
fix-webpack-yuidoc-conflicts
Sep 4, 2019
Merged

remove webpack comments from build (for yuidoc)#377
therewasaguy merged 2 commits intomasterfrom
fix-webpack-yuidoc-conflicts

Conversation

@therewasaguy
Copy link
Member

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.

@therewasaguy therewasaguy force-pushed the fix-webpack-yuidoc-conflicts branch 2 times, most recently from 46650d1 to aa2ec4e Compare September 2, 2019 03:24
@therewasaguy therewasaguy changed the title webpack build extracts comments to a new file for yuidoc remove webpack comments from build (for yuidoc) Sep 2, 2019
@therewasaguy
Copy link
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
@therewasaguy therewasaguy force-pushed the fix-webpack-yuidoc-conflicts branch from aa2ec4e to 11a1602 Compare September 2, 2019 03:32
@therewasaguy therewasaguy merged commit 79dfe37 into master Sep 4, 2019
@montoyamoraga montoyamoraga deleted the fix-webpack-yuidoc-conflicts branch May 5, 2020 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant