Skip to content

Commit

Permalink
Support dual bundle ESM/CJS
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Aug 2, 2022
1 parent 5908fa2 commit c26f5f3
Show file tree
Hide file tree
Showing 8 changed files with 4,571 additions and 8,113 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
13 changes: 13 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ env:
es6: true
extends:
- 'eslint:recommended'
- 'plugin:node/recommended'
- 'plugin:import/recommended'
- 'prettier'
parserOptions:
ecmaVersion: 2020
rules:
no-console: error
prefer-const: error
no-var: error
no-use-before-define: error
no-await-in-loop: error
node/exports-style: [0, error]
import/first: error
import/no-anonymous-default-export: error
import/no-unassigned-import: error
import/no-internal-modules: error
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ npm-debug.log*
.nyc_output
coverage.info
test/fixtures/*/build
node_modules
node_modules
lib
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ yarn add @metalsmith/drafts
Pass the plugin with any options to `Metalsmith.use`.

```js
const drafts = require('@metalsmith/drafts')
import drafts from '@metalsmith/drafts'

metalsmith.use(drafts()) // same as { include: false }
metalsmith.use(drafts(true)) // same as { include: true }
Expand Down Expand Up @@ -56,7 +56,7 @@ metalsmith.use(drafts(inDevelopment))
You can instruct `@metalsmith/drafts` to mark files as `draft` by default if they don't have a `draft` property in their front-matter:

```js
const drafts = require('@metalsmith/drafts')
import drafts from '@metalsmith/drafts'

metalsmith.use(
drafts({
Expand Down
Loading

0 comments on commit c26f5f3

Please sign in to comment.