0.2.2 • Published 4 years ago

snowpack-plugin-mdsvex v0.2.2

Weekly downloads
11
License
MIT
Repository
github
Last release
4 years ago

This plugin was created to be used within a Svelte project, but could possbily be used in a non-Svelte app since this plugin parses .md and .svx files into JS externally of the main Svelte preprocessor loop used in @snowpack/plugin-svelte.

Note: The plugin was archived at one point when the preprocessor option was added to @snowpack/plugin-svelte, however since a Snowpack plugin's resolve.input doesn't allow dyanmic input it was not possible to make Snowpack aware of extensions beyond .svelte.

yarn add snowpack-plugin-mdsvex -D
# or
npm i snowpack-plugin-mdsvex --dev -D

Peer dependencies: svelte, snowpack, mdsvex.

Quick start

If starting a new project, tryout Create Snowpack App (CSA) using either:

  • @snowpack/app-template-svelte
  • @snowpack/app-template-svelte-typescript

Otherwise, after installing, update your snowpack config:

// snowpack.config.json
{
  "plugins": [
    ...
    ["snowpack-plugin-mdsvex", { /* see "Plugin Options" below */ }],
    ...
  ]
}

Plugin Options

interface SnowpackPluginMdsvexOptions {
  /**
   * Includes only the  specified paths
   */
  include?: string[]
  /**
   * Excludes the specified paths
   */
  exclude?: string[]
  /**
   * Include CSS. Default: false
   */
  css?: boolean
  /**
   * These options are passed directly to the MDSvex compiler
   */
  mdsvexOptions?: Record<string, any>
}

Supported MDSvex options:

interface MdsvexOptions {
  /**
   * Use custom extensions
   * example: ['.dvx']
   */
  extensions?: string[]
}
  • extensions: Set if you wish to use any custom extensions. Defaults: ['.md', '.svx'].
  • TODO: View all MDSvex options. With exception to custom extensions, all other MDSvex options have not been tested, but should work.

Acknowledgements

LICENSE

MIT

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago