forked from Kitware/vtk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(webpack): construct package in dist
- Loading branch information
Showing
7 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = (code, replaceFunc) => { | ||
const importRegex = /(?:import|from) ['"]([^'"]*)['"]/g; | ||
while ((m = importRegex.exec(code)) !== null) { | ||
// This is necessary to avoid infinite loops with zero-width matches | ||
if (m.index === importRegex.lastIndex) { | ||
importRegex.lastIndex++; | ||
} | ||
|
||
if (m[1].startsWith('../') || m[1].startsWith('./')) { | ||
const importPath = replaceFunc(m[1]); | ||
code = code.replace(m[0], `from '${importPath}'`); | ||
} | ||
} | ||
return code; | ||
}; |
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters