Skip to content

Commit

Permalink
ES5'd webpack resolver to simplify publish/install
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Nov 26, 2015
1 parent 0b8985e commit f6e9407
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions resolvers/webpack/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import findRoot from 'find-root'
import path from 'path'
import resolve from 'resolve'
const findRoot = require('find-root')
, path = require('path')
, resolve = require('resolve')

/**
* Find the full path to 'source', given 'file' as a full reference path.
Expand All @@ -12,7 +12,7 @@ import resolve from 'resolve'
* @return {string?} the resolved path to source, undefined if not resolved, or null
* if resolved to a non-FS resource (i.e. script tag at page load)
*/
export default function resolveImport(source, file) {
exports.resolveImport = function resolveImport(source, file) {
const packageDir = findRoot(file)
if (!packageDir) throw new Error('package not found above ' + file)

Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/test/alias.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai'
import resolve from '../index'
import { resolveImport as resolve } from '../index'

import path from 'path'

Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/test/extensions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai'
import resolve from '../index'
import { resolveImport as resolve } from '../index'

import path from 'path'

Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/test/externals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai'
import resolve from '../index'
import { resolveImport as resolve } from '../index'

import path from 'path'

Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/test/modules.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai'
import resolve from '../index'
import { resolveImport as resolve } from '../index'
import path from 'path'

const file = path.join(__dirname, 'files', 'dummy.js')
Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/test/root.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai'
import resolve from '../index'
import { resolveImport as resolve } from '../index'

import path from 'path'

Expand Down

0 comments on commit f6e9407

Please sign in to comment.