awesome-typescript-loader

Sharing code between projects using TypeScript and webpack

こ雲淡風輕ζ 提交于 2020-04-10 08:05:28
问题 I want to share code between two TypeScript projects. I don't want to publish shared code to NPM-- just want to put shared code in one project and use it in another project. I'm using Webpack and awesome-ts-loader. Current folder structure (simplified) is like this: /devroot/ mainProject/ tsconfig.json src/ shared/ SomeSharedTypes.ts apiProject/ tsconfig.json webpack.config.js src/ UseSomeSharedType.ts In UseSomeSharedType.ts , I want to be able to import types from SomeSharedTypes.ts . I