Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript compilation #16

Closed
dazinator opened this issue Jan 4, 2017 · 3 comments
Closed

Typescript compilation #16

dazinator opened this issue Jan 4, 2017 · 3 comments
Labels

Comments

@dazinator
Copy link
Owner

Just double check that the following options are exposed as they look like they might be particularly useful:

--declaration (Generates corresponding .d.ts file.)
--declarationDir (Output directory for generated declaration files.)
--isolatedModules (Unconditionally emit imports for unresolved files.)

If NetPack can produce typescript declaration files at runtime, when it compiles the typescript source files within the application, then the appication can later serve these definition files up. This would be useful for a modular application, where when you install a module / extension into the application at runtime, NetPack can compile that modules typescript and produce the d.ts files. If a module author / developer later wants to develop a module that leverages an existing module, they can always grab the relvent modules d.ts files from some location within the application. This will allow them to have design time support / intellisense when authoring their module by manually grabbing and adding the d.ts files to their project.

The --isolatedModules options looks interesting. I need to investigate this to see what this actually does.

`

@dazinator
Copy link
Owner Author

@dazinator
Copy link
Owner Author

Path mapping could be used to allow a system to do a master build of all typescript files.

For example, rather than a modular system, building inidvidual modules containing typescript files, the system could build all modules at once in a single build - where by, one module could reference typescript files supplied by another module.

The way to achieve this would be that a typescript pipe would be set up, with each modules typescript folder listed as an input for the pipe (so that the pipe sees all typescript files). Then, PathMappings would need to be configured such that each module was given a path based on the module's name. That way another module's typescript could reference typescript that is supplied by another module - using the modules name as the path by convention.

This would work at runtime.

To support design time scenarios, the developer would need to be able to download the typescript files that are supplied by that other module, then put them in a local folder on the same path.

@dazinator
Copy link
Owner Author

Paths mapping is only allowed in a project file (tsconfig.json).
The options for the typescript pipe now exposes all of the relevent typescript compiler options including the ability to specify a path to a tsconfig.json - so if you include a tsconfig.json file as an input to the typescript pipe, and you specify the path to that file on the options for the pipe, then there is no reason why you can't do this.

--declaration, --declarationDir, and --isolatedModules can all also be set on the typescript pipe options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant