Skip to content

Commit 37f513e

Browse files
committed
Add karma to peerDependencies and fix some minor errors in readme
1 parent c7c6e65 commit 37f513e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
[Karma](http://karma-runner.github.io) preprocessor to resolve ES6 modules.
33

44
## The problem
5-
Starting version *unreleased* Karma properly supports ES6 modules when running in a suitable environment. Browsers module implementation is limited however to local modules (i.e. `./foo.js`) and browsers will not resolve path missing extension leaving that to the server.
5+
Starting version *unreleased* Karma properly supports ES6 modules when running in a suitable environment. Browsers module implementation is limited however to local modules (i.e. `./foo.js`) and browsers will not resolve paths missing extension leaving that to the server.
66

7-
This preprocessor solves both problems by rewriting import declarations in files on the fly and replacing aliased with relative paths as well as adding extensions if necessary.
7+
This preprocessor solves both problems by rewriting import declarations on the fly and replacing aliased path with relative ones as well as adding extensions if necessary allowing for native ES6 modules testing without compiling or bundling.
88

99
## Installation
1010
```bash
@@ -22,8 +22,7 @@ module.exports = (config) => {
2222
{type: 'module', pattern: 'alias-root/**/*.js'}
2323
],
2424
preprocessors: {
25-
'test/**/*.js': ['module-resolver'],
26-
'alias-root/**/*.js': ['module-resolver']
25+
'test/**/*.js': ['module-resolver']
2726
},
2827
moduleResolverPreprocessor: {
2928
addExtension: 'js',
@@ -79,7 +78,7 @@ A function to be called instead of normal rewriting.
7978

8079
Takes two arguments:
8180
* A string containing imported file path,
82-
* File object for currently processed file containing some meta information, see [karma preprocessor documentation](http://karma-runner.github.io/3.0/dev/plugins.html)
81+
* File object for currently processed file containing some meta information, see [karma preprocessor documentation](http://karma-runner.github.io/3.0/dev/plugins.html).
8382

8483
Return value: string.
8584

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
"license": "MIT",
1818
"dependencies": {
1919
"espree": "^4.0.0"
20+
},
21+
"peerDependencies": {
22+
"karma": "^3.0.0"
2023
}
2124
}

0 commit comments

Comments
 (0)