ElMassimo / iles

๐Ÿ The joyful site generator
https://iles.pages.dev
MIT License
1.08k stars 31 forks source link

๐Ÿ”Œ Modules: ESM imports and configResolved ๐Ÿ”Œ #28

Closed ElMassimo closed 2 years ago

ElMassimo commented 2 years ago

Description ๐Ÿ“–

This pull request renames รฎles plugins to modules to avoid confusion with Vite plugins.

Modules can now be provided as strings, or [string, options] pairs, allowing to conveniently use ESM modules in CJS applications without the need for an async config.

To simplify authoring modules, a base template will be provided. รฎles modules will always be imported as ESM and expect a default import that instantiates the module.

This pull request also adds official modules:

kbd>@islands/headings</kbd

A module that injects a rehype plugin to parse headings in MDX documents:

// iles.config.ts
import { defineConfig } from 'iles'

export default defineConfig({
  modules: [
    '@islands/headings',
  ],
})

kbd>@islands/icons</kbd

A module to add and configure unplugin-icons:

  modules: [
    '@islands/icons',
  ],

Screenshots ๐Ÿ“ท

Screen Shot 2021-11-02 at 12 21 48
netlify[bot] commented 2 years ago

โœ”๏ธ Deploy Preview for iles-docs canceled.

๐Ÿ”จ Explore the source changes: 96a962413f7e8d423fca47f01a65dbb3ab83eac8

๐Ÿ” Inspect the deploy log: https://app.netlify.com/sites/iles-docs/deploys/61815c0482f6430008425262

netlify[bot] commented 2 years ago

โœ”๏ธ Deploy Preview for the-vue-point-with-iles canceled.

๐Ÿ”จ Explore the source changes: 96a962413f7e8d423fca47f01a65dbb3ab83eac8

๐Ÿ” Inspect the deploy log: https://app.netlify.com/sites/the-vue-point-with-iles/deploys/61815c046e95150007e4311c