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
Copy file name to clipboardExpand all lines: README.md
+47-2Lines changed: 47 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ A full test suite runs each night (and on each pull request). It runs both on Li
21
21
- TypeScript 1.7
22
22
- TypeScript 1.6
23
23
24
-
and also:
24
+
and also:
25
25
- TypeScript@next (because we want to use it as much as you do)
26
26
27
27
If you become aware of issues not caught by the test suite then please let us know. Better yet, write a test and submit it in a PR!
@@ -157,7 +157,7 @@ messages are emitted via webpack which is not affected by this flag.
157
157
##### ignoreDiagnostics *(number[]) (default=[])*
158
158
159
159
You can squelch certain TypeScript errors by specifying an array of diagnostic
160
-
codes to ignore.
160
+
codes to ignore.
161
161
162
162
##### compiler *(string) (default='typescript')*
163
163
@@ -179,6 +179,51 @@ Advanced option to force files to go through different instances of the
179
179
TypeScript compiler. Can be used to force segregation between different parts
180
180
of your code.
181
181
182
+
183
+
#### appendTsSuffixTo *(RegExp[]) (default=[])*
184
+
A list of regular expression to be matched against filename. If filename matches one of the regular expressions, a `.ts` suffix will be appended to that filename.
185
+
186
+
This is useful for`*.vue` [file format](https://vuejs.org/v2/guide/single-file-components.html) for now. (Probably will benefits new single file format.)
187
+
188
+
Example:
189
+
190
+
webpack.config.js:
191
+
192
+
```javascript
193
+
module.exports = {
194
+
entry: './index.vue',
195
+
output: { filename: 'bundle.js' },
196
+
resolve: {
197
+
extensions: ['', '.ts', '.vue']
198
+
},
199
+
module: {
200
+
loaders: [
201
+
{ test: /\.vue$/, loader: 'vue' },
202
+
{ test: /\.ts$/, loader: 'ts' }
203
+
]
204
+
},
205
+
ts: {
206
+
appendTsSuffixTo: [/\.vue$/]
207
+
}
208
+
}
209
+
```
210
+
211
+
index.vue
212
+
213
+
```vue
214
+
<template><p>hello {{msg}}</p></template>
215
+
<script lang="ts">
216
+
export default {
217
+
data(): Object {
218
+
return {
219
+
msg: "world"
220
+
}
221
+
},
222
+
}
223
+
</script>
224
+
```
225
+
226
+
182
227
### Loading other resources and code splitting
183
228
184
229
Loading css and other resources is possible but you will need to make sure that
0 commit comments