You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript-Bundle can automatically bundle files with a special import scheme similar to WebPack's [ts-loader](https://github.com/TypeStrong/ts-loader). It supports `text`, `json`, `base64`, and `buffer` directives that inform the bundler how to embed the asset.
103
+
TypeScript-Bundle automatically bundles files with a special import scheme similar to WebPack's [ts-loader](https://github.com/TypeStrong/ts-loader). It supports `text`, `json`, `base64`, `buffer` and `css` directives that inform the bundler how to embed the asset.
104
104
105
105
```typescript
106
106
importTextfrom'text!./file.txt'// as 'string'
107
107
importBase64from'base64!./image.png'// as 'string | base64 encoded'
108
108
importObjfrom'json!./file.json'// as 'any'
109
109
importBuffrom'buffer!./file.dat'// as 'Uint8Array'
110
+
importCssfrom'css!./file.css'// as 'string | @import concat'
110
111
```
111
112
112
113
### Declarations
@@ -129,6 +130,10 @@ declare module '*.buf' {
129
130
const value:Uint8Array
130
131
exportdefaultvalue
131
132
}
133
+
declaremodule'*.css' {
134
+
const value:string
135
+
exportdefaultvalue
136
+
}
132
137
```
133
138
You can either add this declaration to your `tsconfig.json` or as a `/// <reference path='extensions.d.ts' />` directive if bundling from script.
0 commit comments