mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Update TS example
This commit is contained in:
parent
03f2e133b1
commit
d9d5d1a5d8
19
examples/typescript/index.d.ts
vendored
19
examples/typescript/index.d.ts
vendored
@ -1,19 +0,0 @@
|
||||
//Deleting this file will cause "TS18003: No inputs were found in config file 'tsconfig.json'"
|
||||
|
||||
//These declarations allow TypeScript to import non-js/ts files without the file extensions (such as .vue files)
|
||||
declare module "~components/*" {
|
||||
}
|
||||
|
||||
declare module "~layouts/*" {
|
||||
}
|
||||
|
||||
declare module "~pages/*" {
|
||||
}
|
||||
|
||||
declare module "~assets/*" {
|
||||
|
||||
}
|
||||
|
||||
declare module "~static/*" {
|
||||
|
||||
}
|
@ -3,14 +3,14 @@ module.exports = function (options, next) {
|
||||
this.extendBuild((config) => {
|
||||
// Add TypeScript loader
|
||||
config.module.rules.push({
|
||||
test: /\.ts$/,
|
||||
loader: 'ts-loader'
|
||||
test: /\.ts$/,
|
||||
loader: 'ts-loader'
|
||||
})
|
||||
// Add TypeScript loader for vue files
|
||||
for (rule of config.module.rules) {
|
||||
if (rule.loader === 'vue-loader') {
|
||||
rule.query.loaders.ts = 'ts-loader?{"appendTsSuffixTo":["\\\\.vue$"]}'
|
||||
}
|
||||
if (rule.loader === 'vue-loader') {
|
||||
rule.query.loaders.ts = 'ts-loader?{"appendTsSuffixTo":["\\\\.vue$"]}'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
"dependencies": {
|
||||
"axios": "^0.16.1",
|
||||
"gsap": "^1.19.1",
|
||||
"nuxt": "latest",
|
||||
"nuxt": "^1.0.0-alpha2",
|
||||
"nuxt-class-component": "^1.0.1",
|
||||
"tachyons": "^4.7.0",
|
||||
"vue-class-component": "^5.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user