Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
--- name: Add test to fs.readFileSync in TypeScript files --- ``` parcel-bundler version 1.9.7 ``` ## 💥 Problem Inlining file in browser mode doesn't work in TypeScript files when `fs` is imported with star import or default import. The only way to use `readFileSync` is: ```typescript import { readFileSync } from 'fs'; const raw = readFileSync(__dirname + '/raw.tsx', 'utf-8'); ``` ### Reproduction: Repo: https://github.com/hasparus/parcel-readfilesync-typescript-repro ghPages: https://hasparus.github.io/parcel-readfilesync-typescript-repro/ CodeSandbox: https://codesandbox.io/s/github/hasparus/parcel-readfilesync-typescript-repro/tree/master/ Fun Fact: All ways to import `fs` work on CodeSandbox (parcel template). ## ↪️ Pull Request Adds test to `fs.readFileSync` in TypeScript files and thus provides better workaround for #1736. ## ✔️ PR Todo - [X] Link in #1736. - [X] Post reproduction to CodeSandbox. - [ ] Document how to use `readFileSync` in TypeScript?
- Loading branch information