Skip to content

Commit

Permalink
[fix] Preset Path & Document of Custom Configuration (fix #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Aug 8, 2024
1 parent 1e69a82 commit e25b3bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Unofficial [MDX][1] 3 [transformer plugin][2] for [Parcel][3] 2

[![NPM](https://nodei.co/npm/parcel-transformer-mdx.png?downloads=true&downloadRank=true&stars=true)][6]

## Supported features
## Preset features

1. [GitHub flavored Markdown (GFM)](https://github.com/remarkjs/remark-gfm)
2. [Frontmatter](https://github.com/remarkjs/remark-frontmatter)
Expand Down Expand Up @@ -95,6 +95,10 @@ https://www.youtube.com/watch?v=VEoMT8pAxMA

- WebCell example: https://github.com/EasyWebApp/BootCell-document

## Custom Configuration

Create a `mdx.config.js` file in the root folder of your project, and export your [`CompileOptions` object][7] as what [the internal preset][8] does.

## Inspiration

https://github.com/parcel-bundler/parcel/pull/7922
Expand All @@ -105,3 +109,5 @@ https://github.com/parcel-bundler/parcel/pull/7922
[4]: https://libraries.io/npm/parcel-transformer-mdx
[5]: https://github.com/EasyWebApp/Parcel-transformer-MDX/actions/workflows/main.yml
[6]: https://nodei.co/npm/parcel-transformer-mdx/
[7]: https://mdxjs.com/packages/mdx/#compileoptions
[8]: source/preset.js
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Transformer } from '@parcel/plugin';
import { compile } from '@mdx-js/mdx';

import MDXPreset from './source/preset';
import { BabelConfigFiles, MDXConfigFiles } from './source/utility';
import MDXPreset from './source/preset.js';
import { BabelConfigFiles, MDXConfigFiles } from './source/utility.js';

export { MDXPreset };
export * from './source/utility';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parcel-transformer-mdx",
"version": "0.4.0",
"version": "0.4.1",
"license": "LGPL-3.0-or-later",
"author": "shiy2008@gmail.com",
"description": "Unofficial MDX 3 transformer plugin for Parcel 2",
Expand Down

0 comments on commit e25b3bb

Please sign in to comment.