Niklas Mischkulnig

Results 290 comments of Niklas Mischkulnig

I think something like `` (the attribute would be removed by Parcel) or ```js // ... ``` would make sense

If just reading the file contents are enough for you then yes, readFileSync should work: https://parceljs.org/features/node-emulation/#inlining-fs.readfilesync The difference with bundle-text is that it first processes/transpiles the file before inlining.

I've tried this: ``` { "source": "index.ts", "types": "dist/index.d.ts", "scripts": { "build": "parcel build . --no-cache" }, "dependencies": { "parcel": "2.0.0-nightly.579", "typescript": "^4.1.5" } } ``` ```ts // index.ts export...

When using Windows line endings (cr + lf), [the sourcemaps are wrong](https://evanw.github.io/source-map-visualization/#MzM5AGNvbnNvbGUubG9nKCJ0ZXN0MSIpIC8vIGxpbmUgMSBjb3JyZWN0CjsKbGV0IHRleHQgPSBgDQogICAgMQ0KICAgIDENCiAgICAxDQogICAgMQ0KICAgIDENCiAgICAxDQogICAgYDsKY29uc29sZS5sb2coInRlc3QyIikgLy8gdGhpcyBzaG91bGQgYmUgbGluZSAxMiwgaW5zdGVhZCAxNyBpbiBkZXZ0b29scwo7CmxldCB0ZXN0MDsKbGV0IHRlc3QxOwpjb25zb2xlLmxvZygidGVzdDMiKSAvLyB0aGlzIG9ubHkgd29rcyBiZWNhdXNlIGxhc3QgbGluZSBpZiB5b3UgYWRkIG1vcmUgY29udGVudCBpdCB3b250IHdvcmsKOwoKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW5kZXguZDJlMGE0MmEuanMubWFwCjY2MgB7Im1hcHBpbmdzIjoiQUFBQyxPQUFPLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDLGlCQUFpQjs7QUFFdkMsSUFBSSxJQUFJLEdBQUcsQ0FBQyxnREFPUixDQUFDO0FBRUwsT0FBTyxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQyxpREFBaUQ7O0FBRXRFLElBQUksS0FBSztBQUNULElBQUksS0FBSztBQUVULE9BQU8sQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUUsd0VBQXdFIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIgY29uc29sZS5sb2coXCJ0ZXN0MVwiKSAvLyBsaW5lIDEgY29ycmVjdFxyXG5cclxubGV0IHRleHQgPSBgXHJcbiAgICAxXHJcbiAgICAxXHJcbiAgICAxXHJcbiAgICAxXHJcbiAgICAxXHJcbiAgICAxXHJcbiAgICBgXHJcblxyXG5jb25zb2xlLmxvZyhcInRlc3QyXCIpIC8vIHRoaXMgc2hvdWxkIGJlIGxpbmUgMTIsIGluc3RlYWQgMTcgaW4gZGV2dG9vbHNcclxuXHJcbmxldCB0ZXN0MFxyXG5sZXQgdGVzdDFcclxuXHJcbmNvbnNvbGUubG9nKFwidGVzdDNcIikgIC8vIHRoaXMgb25seSB3b2tzIGJlY2F1c2UgbGFzdCBsaW5lIGlmIHlvdSBhZGQgbW9yZSBjb250ZW50IGl0IHdvbnQgd29yayJdLCJuYW1lcyI6W10sInZlcnNpb24iOjMsImZpbGUiOiJpbmRleC5kMmUwYTQyYS5qcy5tYXAifQ==):

Indeed, with this simple test (using the tsc transformer) ```html ``` a.ts: ```ts import "./b"; console.log("a") ``` b.ts ```ts // .... console.log("b"); ``` it seems that the sourcemaps reflect the...

(This isn't specific to inline sourcemaps) https://github.com/parcel-bundler/parcel/tree/5815-ts-sourcemap seems to fix it for `--no-scope-hoist` (= and development). But the maps with scope-hoisting is still broken as before.

@DeMoorJasper is https://github.com/babel/babel/pull/12471 needed to get scope hoisting working? Or does that have nothing to do with this?

That should already be fixed in the latest nightly: https://github.com/parcel-bundler/parcel/pull/6024

If anyone still has this problem: please post a code sample so that we can reproduce this.

@Levminer That's working correctly for me. What Parcel version are you using? If it's indeed 2.6.2, then please share a complete example including package.json/lockfile/... as a repo or a zip...