Skip to content

Commit

Permalink
Revert "Remove jsx resolver"
Browse files Browse the repository at this point in the history
This reverts commit 5e3ef1a.
  • Loading branch information
timneutkens committed Dec 5, 2017
1 parent 5e3ef1a commit 8248e50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@ function getPaths (id) {
const i = sep === '/' ? id : id.replace(/\//g, sep)

if (i.slice(-3) === '.js') return [i]
if (i.slice(-4) === '.jsx') return [i]
if (i.slice(-5) === '.json') return [i]

if (i[i.length - 1] === sep) {
return [
i + 'index.js',
i + 'index.jsx',
i + 'index.json'
]
}

return [
i + '.js',
join(i, 'index.js'),
i + '.jsx',
join(i, 'index.jsx'),
i + '.json',
join(i, 'index.json')
]
Expand Down

0 comments on commit 8248e50

Please sign in to comment.