Skip to content

Commit d4a4471

Browse files
committed
add default support for typescript
1 parent d2c14f6 commit d4a4471

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/loader.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ module.exports = function (content) {
7878
// css: (isServer ? '' : styleLoaderPath + '!') + 'css-loader' + (needCssSourceMap ? '?sourceMap' : ''),
7979
css: styleLoaderPath,
8080
js: scriptLoaderPath + '!' + (hasBuble ? ('buble-loader' + bubleOptions) : hasBabel ? ('babel-loader' + babelOptions) : ''),
81+
ts: [{
82+
loader: 'ts-loader',
83+
options: { appendTsSuffixTo: [/\.vue$/] }
84+
}],
8185
scss: ['sass-loader'],
8286
sass: [{
8387
loader: 'sass-loader',
@@ -186,6 +190,11 @@ module.exports = function (content) {
186190
loader += '!' + templateLoaderPath + '?raw&engine=' + lang + '!'
187191
}
188192
}
193+
if (type === 'script') {
194+
if (lang && Array.isArray(loaders[lang])) {
195+
loader += '!' + stringifyLoaders(loaders[lang])
196+
}
197+
}
189198
// inject rewriter before css/html loader for
190199
// extractTextPlugin use cases
191200
if (rewriterInjectRE.test(loader)) {

0 commit comments

Comments
 (0)