Skip to content

Commit

Permalink
Provides dual ESM/CJS bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Sep 26, 2022
1 parent 8df9e65 commit 61430d4
Show file tree
Hide file tree
Showing 8 changed files with 13,573 additions and 5,861 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
15 changes: 13 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ env:
es6: true
extends:
- 'eslint:recommended'
- 'plugin:node/recommended'
- 'plugin:import/recommended'
- 'prettier'
parserOptions:
ecmaVersion: 2017
ecmaVersion: 2020
rules:
prefer-const: 2
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/index.*js
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ yarn add @metalsmith/collections
Pass options to `@metalsmith/collections` in the plugin chain:

```js
const Metalsmith = require('metalsmith')
const markdown = require('@metalsmith/markdown')
const collections = require('@metalsmith/collections')
import Metalsmith from 'metalsmith'
import markdown from '@metalsmith/markdown'
import collections from '@metalsmith/collections'
import { dirname } from 'path'

const __dirname = dirname(new URL(import.meta.url).pathname)

// defaults, only create collections based on file metadata
Metalsmith(__dirname)
Expand Down
Loading

0 comments on commit 61430d4

Please sign in to comment.