A custom transformer that can be used with ttypescript to transform ts imports to browser style imports
Home > config > PluginConfigs > folderImport
Resolve NodeJS style path â./xâ to â./x/index.jsâ
Signature:
folderImport?: boolean
Resolve NodeJS style folder import to their correct path.
Not recommend because it never will become a Web standard.
Only open it when your codebase is not easy to migrate from Node specified behaviors.
Source:
Filename: folder-import/index.ts
import './folder'
Filename: folder-import/folder/index.ts
export default 0
import '../f2'
Filename: folder-import/f2/index.ts
export {}
Filename: folder-import/f2/f2.ts
import './'
Filename: folder-import/f2/inner/f.ts
import '../'
Output:
Filename: folder-import/index.js
import "./folder/index.js";
Filename: folder-import/folder/index.js
export default 0;
import "../f2/index.js";
Filename: folder-import/f2/index.js
export {};
Filename: folder-import/f2/f2.js
import "./index.js";
Filename: folder-import/f2/inner/f.js
import "../index.js";