Skip to content

Commit

Permalink
fixes #3 - support /* and */ and some edge cases (#4)
Browse files Browse the repository at this point in the history
* fixes #3 - support `/*` and `*/` and some edge cases

* up version
  • Loading branch information
frankleng authored Mar 4, 2022
1 parent dca93c8 commit fd09428
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const path = require("path");
const fs = require('fs');

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

module.exports = (relativeTsconfigPath = './tsconfig.json') => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "esbuild-ts-paths",
"version": "1.1.0",
"version": "1.1.1",
"description": "Transform TS path alias to absolute paths for esbuild",
"main": "index.js",
"repository": "git@github.com:frankleng/esbuild-ts-paths.git",
Expand Down

0 comments on commit fd09428

Please sign in to comment.