Skip to content

Commit

Permalink
Import using file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
razor-x committed Dec 8, 2020
1 parent 443ea82 commit 34f4cd2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions examples/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import path from 'path'

import createExamples from '@meltwater/examplr'
import examplr from '@meltwater/examplr'

import todo from './todo'
import todo from './todo.js'

const { createExamples } = examplr

const examples = {
todo
Expand Down
2 changes: 1 addition & 1 deletion examples/todo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { todo } from '../'
import { todo } from '../index.js'

export default ({ log }) => async (check = true) => {
log.debug({ check }, 'Input')
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default } from './lib'
export * from './lib'
export { default } from './lib.js'
export * from './lib.js'
2 changes: 1 addition & 1 deletion lib/todo.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'ava'

import { todo } from './todo'
import { todo } from './todo.js'

test('todo: returns argument', async (t) => {
t.true(todo(true), 'returns true')
Expand Down

0 comments on commit 34f4cd2

Please sign in to comment.