Skip to content

Commit fd09428

Browse files
authored
fixes #3 - support /* and */ and some edge cases (#4)
* fixes #3 - support `/*` and `*/` and some edge cases * up version
1 parent dca93c8 commit fd09428

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ const path = require("path");
33
const fs = require('fs');
44

55
function stripJsonComments (data) {
6-
const re = new RegExp("\/\/(.*)","g");
7-
return data.replace(re,'');
6+
return data.replace(/\\"|"(?:\\"|[^"])*"|(\/\/.*|\/\*[\s\S]*?\*\/)/g, (m, g) => g ? "" : m);
87
}
98

109
module.exports = (relativeTsconfigPath = './tsconfig.json') => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "esbuild-ts-paths",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Transform TS path alias to absolute paths for esbuild",
55
"main": "index.js",
66
"repository": "git@github.com:frankleng/esbuild-ts-paths.git",

0 commit comments

Comments
 (0)