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,16 +3,16 @@ module.exports = function (options, next) {
|
|||||||
this.extendBuild((config) => {
|
this.extendBuild((config) => {
|
||||||
// Add TypeScript loader
|
// Add TypeScript loader
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
loader: 'ts-loader'
|
loader: 'ts-loader'
|
||||||
})
|
})
|
||||||
// Add TypeScript loader for vue files
|
// Add TypeScript loader for vue files
|
||||||
for (rule of config.module.rules) {
|
for (rule of config.module.rules) {
|
||||||
if (rule.loader === 'vue-loader') {
|
if (rule.loader === 'vue-loader') {
|
||||||
rule.query.loaders.ts = 'ts-loader?{"appendTsSuffixTo":["\\\\.vue$"]}'
|
rule.query.loaders.ts = 'ts-loader?{"appendTsSuffixTo":["\\\\.vue$"]}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.16.1",
|
"axios": "^0.16.1",
|
||||||
"gsap": "^1.19.1",
|
"gsap": "^1.19.1",
|
||||||
"nuxt": "latest",
|
"nuxt": "^1.0.0-alpha2",
|
||||||
"nuxt-class-component": "^1.0.1",
|
"nuxt-class-component": "^1.0.1",
|
||||||
"tachyons": "^4.7.0",
|
"tachyons": "^4.7.0",
|
||||||
"vue-class-component": "^5.0.1",
|
"vue-class-component": "^5.0.1",
|
||||||
@ -21,4 +21,4 @@
|
|||||||
"ts-loader": "^2.0.3",
|
"ts-loader": "^2.0.3",
|
||||||
"typescript": "^2.2.2"
|
"typescript": "^2.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user