Skip to content

Commit fcfb099

Browse files
committed
fix: ensure loaders exist
1 parent a80cf18 commit fcfb099

File tree

1 file changed

+4
-5
lines changed
  • packages/@vue/cli-plugin-typescript

1 file changed

+4
-5
lines changed

packages/@vue/cli-plugin-typescript/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = (api, options) => {
2626
.rule('vue')
2727
.use('vue-loader')
2828
.tap(options => {
29+
options.loaders = options.loaders || {}
2930
options.loaders.ts = [
3031
{
3132
loader: 'cache-loader',
@@ -48,11 +49,9 @@ module.exports = (api, options) => {
4849
.loader('babel-loader')
4950
vueLoader
5051
.tap(options => {
51-
if (api.hasPlugin('babel')) {
52-
options.loaders.ts.push({
53-
loader: 'babel-loader'
54-
})
55-
}
52+
options.loaders.ts.push({
53+
loader: 'babel-loader'
54+
})
5655
return options
5756
})
5857
}

0 commit comments

Comments
 (0)