Comments (2)
Hi there, sorry for the late response!
Technically it´s possible of course, however, that would be a major task, let me describe how it
works when TSPath is generating new paths in your JavaScript files.
The raw JavaScript file is read from disk and fed into a Script parser which generates an
Abstract Syntax Tree, that makes it very easy to navigate the source and find the imports
that will be updated, when the imports have been updated the AST is fed to an
ECMAScript Generator which generates a new JavaScript file, the process is very similar
to WebPack and similar tools.
So, the entire file is "re-generated", the alternative to this would be some kind of string
matching with RegExp to find the imports and update that specific line, since that would
be a "hacky" way to do it, it´s not a direction I wanna take TSPath, however, let´s figure
out how to fix this :)
Could you please provide me with some examples of "broken" source maps, exactly what
is it that breaks?
the alternative to this would be some kind of string
is using a Script parser
using a ECMAScript code generator
from tspath.
for me the translated code is kindof minified (all newlines are removed) which makes debugging hard
did you find a solution @cdagli ?
from tspath.
Related Issues (20)
- Not substitue path in d.ts HOT 6
- Retain line breaks HOT 2
- TypeError: Cannot read property 'type' of undefined HOT 1
- Output dir should relative to root, not source dir HOT 4
- --filter and --force don't work HOT 3
- SyntaxError: Unexpected token } in JSON at position 381 HOT 2
- execute after tsc build HOT 3
- Doesn't work with paths declared in an extended tsconfig.json HOT 2
- Not reading output file directly HOT 1
- Reworked your package
- Support '#!/usr/bin/env ts-node' scripts
- Mixed output slashes - Cannot find module './src\util\getSomething' HOT 1
- Unable to parse file: 'Unexpected token ...' HOT 2
- tspath works incorrect
- High vulnerability from set-value HOT 1
- TypeError: chalk.red.bold is not a function HOT 2
- Path resolution has too many `..` when `paths` does not stem from project dir
- JS paths not being replaced
- Minor bug: Dependency name mistaken as a path
- How do I install and run this please? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tspath.