babel-resolver
Advanced tools
Comparing version 0.0.15 to 0.0.16
import assert from 'assert'; | ||
import utils from 'utils'; | ||
import UserModel from 'models/User'; | ||
import UserList from 'views/UserList'; | ||
assert(utils === 'utils'); | ||
assert(UserModel === 'UserModel'); | ||
assert(UserList === 'UserList'); | ||
export default 'UserController'; |
v0.0.16 / 2015-11-21 | ||
==================== | ||
* bump version | ||
* support '.jsx' file extensions, resolves #1 | ||
* more rearranging | ||
* deitalicize | ||
* rearrange | ||
* more wordiness | ||
* wordiness | ||
* spacing | ||
* changelog v0.0.15 | ||
v0.0.15 / 2015-11-13 | ||
@@ -3,0 +16,0 @@ ==================== |
@@ -7,3 +7,3 @@ var findNodeModulesPath = require('./findNodeModulesPath'); | ||
var nodeModulesPath = findNodeModulesPath(__dirname); | ||
var extensionsToTry = ['.js', '.json']; | ||
var extensionsToTry = ['.js', '.json', '.jsx']; | ||
@@ -14,6 +14,4 @@ if (nodeModulesPath && moduleDirsToCheck.indexOf(nodeModulesPath) === -1) { | ||
return function (source) { | ||
return resolveModuleSource(source, moduleDirsToCheck, extensionsToTry); | ||
}; | ||
return function (source) { return resolveModuleSource(source, moduleDirsToCheck, extensionsToTry); }; | ||
}; | ||
{ | ||
"name": "babel-resolver", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "Resolve modules from any directory.", | ||
@@ -5,0 +5,0 @@ "main": "lib/createBabelResolver.js", |
# Babel Resolver [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Coverage status][coveralls-image]][coveralls-url] | ||
*To configure this using .babelrc, use the [Babel Resolver Plugin](https://github.com/jshanson7/babel-plugin-resolver)* | ||
Resolve modules from any directory. | ||
@@ -38,2 +36,4 @@ | ||
If you wish to define options in .babelrc, use the [Babel Resolver Plugin](https://github.com/jshanson7/babel-plugin-resolver) instead. | ||
**Note:** Run `rm -rf ~/.babel.json` if you're seeing errors. | ||
@@ -40,0 +40,0 @@ |
@@ -6,3 +6,3 @@ var assert = require('assert'); | ||
function pathExists(path) { | ||
return autoExtensionedPathExists(path, ['.js', '.json']); | ||
return autoExtensionedPathExists(path, ['.js', '.json', '.jsx']); | ||
} | ||
@@ -46,2 +46,10 @@ | ||
}); | ||
it('existing file with .jsx', function () { | ||
assert(pathExists(getFullPath('../example-app/views/UserList.jsx'))); | ||
}); | ||
it('non-existing file with .jsx extension', function () { | ||
assert(!pathExists(getFullPath('../example-app/views/foo.jsx'))); | ||
}); | ||
}); |
@@ -12,3 +12,3 @@ var assert = require('assert'); | ||
[nodeModulesDir, exampleAppDir, exampleAppLibDir], | ||
['.js', '.json'] | ||
['.js', '.json', '.jsx'] | ||
); | ||
@@ -15,0 +15,0 @@ } |
14024
29
214