Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit 8f7f455

Browse files
author
Stanislav Panferov
committed
feat(*): rewriteImports is an array now
1 parent 0a37610 commit 8f7f455

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ Specify path to a TS config file. Useful when you have multiple config files. Th
9999

100100
Use this setting to force loader to use webpack's way to load files. Useful only with ts-jsx-loader. Builds may become slower.
101101

102-
### rewriteImports *(string)*
102+
### rewriteImports *(array)*
103103

104-
Comma-separated list of modules that must be processed by webpack in imports. Useful if you want to use `some-lib`
104+
Array of modules that must be processed by webpack in imports. Useful if you want to use `some-lib`
105105
with pure TS files inside your app.
106106

107107
### externals *(string)*

src/deps.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ function pathWithoutExt(fileName) {
3131
}
3232

3333
function needRewrite(rewriteImports, importPath): boolean {
34-
return rewriteImports && _.any(rewriteImports.split(','), (i) => importPath.indexOf(i) !== -1)
34+
return rewriteImports && _.any(rewriteImports, (i) => {
35+
return importPath.split('/')[0] == i
36+
})
3537
}
3638

3739
function updateText(text, pos, end, newText): string {

0 commit comments

Comments
 (0)