1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-11 00:14:42 +01:00

refs #850 Convert typescript in i18n

This commit is contained in:
AkiraFukushima 2019-03-21 23:23:57 +09:00
parent 490bb3b2ac
commit 2fa86dddd2
7 changed files with 21 additions and 9 deletions

View File

@ -65,7 +65,6 @@ let rendererConfig = {
{
test: /\.ts$/,
exclude: /node_modules/,
// include: path.join(__dirname , '../node_modules/vue-awesome'),
use: {
loader: 'ts-loader',
options: {
@ -157,11 +156,12 @@ let rendererConfig = {
},
resolve: {
alias: {
// Same as tsconfig.json
'@': path.join(__dirname, '../src/renderer'),
'~': path.join(__dirname, '../'),
'vue$': 'vue/dist/vue.esm.js'
},
extensions: ['.js', '.vue', '.json', '.css', '.node', '.ts']
extensions: ['.ts', '.js', '.vue', '.json', '.css', '.node']
},
target: 'electron-renderer'
}

6
package-lock.json generated
View File

@ -560,6 +560,12 @@
"@types/node": "11.11.4"
}
},
"@types/i18next": {
"version": "12.1.0",
"resolved": "https://registry.npmjs.org/@types/i18next/-/i18next-12.1.0.tgz",
"integrity": "sha512-qLyqTkp3ZKHsSoX8CNVYcTyTkxlm0aRCUpaUVetgkSlSpiNCdWryOgaYwgbO04tJIfLgBXPcy0tJ3Nl/RagllA==",
"dev": true
},
"@types/node": {
"version": "11.11.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.4.tgz",

View File

@ -152,6 +152,7 @@
},
"devDependencies": {
"@mapbox/stylelint-processor-arbitrary-tags": "^0.2.0",
"@types/i18next": "^12.1.0",
"@types/node": "^11.11.4",
"@vue/test-utils": "^1.0.0-beta.28",
"ajv": "^6.6.1",

View File

@ -1,8 +1,9 @@
import path from 'path'
import i18next from 'i18next'
import Backend from 'i18next-sync-fs-backend'
import * as path from 'path'
import * as i18next from 'i18next'
import * as Backend from 'i18next-sync-fs-backend'
import { InitOptions } from 'i18next'
const options = {
const options: InitOptions = {
initImmediate: false,
lng: 'en',
backend: {

View File

@ -36,7 +36,7 @@ sync(store, router)
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.config.productionTip = false
const i18n = new VueI18Next(i18next)
const i18n: VueI18Next = new VueI18Next(i18next)
/* eslint-disable no-new */
new Vue({

View File

@ -37,8 +37,11 @@
/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"baseUrl": "./", /* Base directory to resolve non-absolute module names. */
"paths": {
"@*": ["src/renderer*"],
"~*": ["./*"]
},
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
"typeRoots": ["./types"], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */

1
types/i18next-sync-fs-backend.d.ts vendored Normal file
View File

@ -0,0 +1 @@
declare module 'i18next-sync-fs-backend'