-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add special case for remark-prism
#232
Conversation
Codecov Report
@@ Coverage Diff @@
## main #232 +/- ##
==========================================
+ Coverage 80.04% 80.11% +0.06%
==========================================
Files 13 13
Lines 1433 1438 +5
Branches 537 538 +1
==========================================
+ Hits 1147 1152 +5
Misses 114 114
Partials 172 172
Continue to review full report at Codecov.
|
src/utils/special-cases.ts
Outdated
if (id.endsWith(file)) { | ||
try { | ||
const prefix = id.slice(0, -file.length); | ||
emitAsset(resolve(prefix, `prismjs/components/prism-markdown.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.
Should this only be adding prism-markdown
or should we be including all of the files in the components folder here since we won't know which are needed?
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 PR adds a special case since
nft
can't statically analyze this dynamicrequire.resolve()
:https://github.com/sergioramos/remark-prism/blob/49f1f86d50f376c647214c02cf972ce05b0fc756/src/highlight.js#L74