Last active
January 9, 2019 11:19
-
-
Save rummelonp/42bf4d1db4b6bbeb09d163cf69083f63 to your computer and use it in GitHub Desktop.
nuxt 用の ts && tslint の設定
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function() { | |
this.nuxt.options.extensions.push('ts') | |
this.extendBuild(config => { | |
config.module.rules.push( | |
{ | |
test: /\.tsx?$/, | |
loader: 'ts-loader', | |
options: { | |
appendTsSuffixTo: [/\.vue$/] | |
} | |
}, | |
{ | |
test: /\.tsx?$/, | |
enforce: 'pre', | |
loader: 'vue-tslint-loader' | |
} | |
) | |
for (let rule of config.module.rules) { | |
if (rule.loader === 'vue-loader') { | |
rule.options.loaders = { | |
ts: 'ts-loader!vue-tslint-loader' | |
} | |
} | |
} | |
if (config.resolve.extensions.indexOf('.ts') === -1) { | |
config.resolve.extensions.push('.ts') | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment