Skip to content
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

Usage or marp-core in browser context #314

Closed
sinedied opened this issue Aug 23, 2022 · 2 comments · Fixed by #315
Closed

Usage or marp-core in browser context #314

sinedied opened this issue Aug 23, 2022 · 2 comments · Fixed by #315
Assignees
Labels
bug Something isn't working

Comments

@sinedied
Copy link

Hello!

I'm interested in integrating @marp-team/marp-core in an existing Angular app to convert markdown on-the-fly.
But when I'm following the base instructions, I get this error in the browser:
image

It seems that some CJS dependencies relies on Node-specific features like __dirname, breaking code execution. Is there a workaround or a pre-built marp-core that we could use?

Thanks

@yhatt
Copy link
Member

yhatt commented Aug 23, 2022

I found postcss-minify-params for CSS minification is depending on CJS __dirname.
https://github.com/cssnano/cssnano/blob/747f16c36f30f0f97e6b6793b8952b3e7d890025/packages/postcss-minify-params/src/index.js#L99

This error is not what we expected so I'm considering to deal with this by some way, but you can try to disable CSS minification by minifyCSS: false constructor option as a workaround.

const marp = new Marp({ minifyCSS: false });

@yhatt yhatt added the bug Something isn't working label Aug 23, 2022
@yhatt yhatt self-assigned this Aug 23, 2022
@sinedied
Copy link
Author

Thanks, I'll try that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants