Skip to content

Raw import of .ts files as text with build-angular:application #26575

Description

Command

build, serve

Description

A similar issue (#26368) has been opened and resolved already with the loader config options for custom extensions/types.

Unfortunately the implemented solution still lacks the ability to perform raw imports of .ts files. This is vital for some use-cases where documenting the examples shown in an application (IE: technical docs for a library) is achieved by including the plain source files themselves as part of the text content rendered in the app.

Describe the solution you'd like

The loader prefix used in webpack to force a particular behaviour was quite a neat solution. Anything done when defining the import file path (ie: import textContent from 'raw:./file.ts') is preferable over a generic project metadata config, imho.

Describe alternatives you've considered

The only possible solution at the moment seems to maintain a copy of the source file with a .txt extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions