Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit deb5d26

Browse files
authored
Merge pull request #18 from hisasann/feature/update-nuxt-2.8.0
Feature/update nuxt 2.8.0
2 parents d94e32e + b94ecf7 commit deb5d26

File tree

10 files changed

+3510
-2476
lines changed

10 files changed

+3510
-2476
lines changed

nuxt.config.ts

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
// https://qiita.com/iwata@github/items/5bc61ea9ca1c692d0370
2-
import { Configuration } from 'webpack'
3-
import { Context } from '@nuxt/vue-app'
1+
import NuxtConfiguration from '@nuxt/config'
2+
import {
3+
Configuration as WebpackConfiguration,
4+
Options as WebpackOptions,
5+
Plugin as WebpackPlugin
6+
} from 'webpack'
47
import routers from './src/routers/'
58

69
const pkg = require('./package')
710

811
const isProduction = process.env.BUILD_ENV === 'production'
912

10-
module.exports = {
13+
const config: NuxtConfiguration = {
1114
mode: 'universal',
1215
srcDir: 'src/',
1316

@@ -16,11 +19,11 @@ module.exports = {
1619
* ビルド時に渡される env の値は、ここに記載することで文字列に置換される
1720
*/
1821
env: {
19-
NODE_ENV: process.env.NODE_ENV,
20-
BUILD_ENV: process.env.BUILD_ENV,
21-
envName: process.env.envName,
22-
internalEndpointUrl: process.env.internalEndpointUrl,
23-
externalEndpointUrl: process.env.externalEndpointUrl
22+
NODE_ENV: process.env.NODE_ENV || '',
23+
BUILD_ENV: process.env.BUILD_ENV || '',
24+
envName: process.env.envName || '',
25+
internalEndpointUrl: process.env.internalEndpointUrl || '',
26+
externalEndpointUrl: process.env.externalEndpointUrl || ''
2427
},
2528

2629
/**
@@ -31,7 +34,15 @@ module.exports = {
3134
/**
3235
* You can extend webpack config here
3336
*/
34-
extend(config: Configuration, ctx: Context): void {
37+
extend(
38+
config: WebpackConfiguration,
39+
ctx: {
40+
isDev: boolean
41+
isClient: boolean
42+
isServer: boolean
43+
loaders: any
44+
}
45+
): void {
3546
// Run ESLint on save
3647
if (ctx.isDev && process.client) {
3748
if (config.module) {
@@ -112,12 +123,12 @@ module.exports = {
112123
* Plugins to load before mounting the App
113124
*/
114125
plugins: [
115-
'@/plugins/axios.ts',
116126
'@/plugins/constants-inject.ts',
117127
'@/plugins/env-inject.ts',
118-
'@/plugins/vue-lazyload.ts',
119-
'@/plugins/i18n.ts',
120-
{ src: '@/plugins/vue-carousel.ts', ssr: false }
128+
'@/plugins/libraries/axios.ts',
129+
'@/plugins/libraries/vue-lazyload.ts',
130+
'@/plugins/locale/i18n.ts',
131+
{ src: '@/plugins/libraries/vue-carousel.ts', ssr: false }
121132
],
122133

123134
/*
@@ -190,3 +201,5 @@ module.exports = {
190201
{ path: '/api/healthcheck', handler: '~/api/healthcheck.js' }
191202
]
192203
}
204+
205+
module.exports = config

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,65 +47,65 @@
4747
"url": "https://github.com/hisasann/typescript-nuxtjs-boilerplate/issues"
4848
},
4949
"dependencies": {
50-
"@nuxt/typescript": "^2.6.2",
51-
"@nuxtjs/axios": "^5.4.1",
50+
"@nuxt/typescript": "^2.8.0",
51+
"@nuxtjs/axios": "^5.5.3",
5252
"@nuxtjs/pwa": "^3.0.0-beta.14",
53-
"@nuxtjs/sentry": "^2.3.2",
54-
"@types/webpack": "^4.4.27",
53+
"@nuxtjs/sentry": "^3.0.0",
54+
"@types/webpack": "^4.4.32",
5555
"@ungap/url-search-params": "^0.1.2",
5656
"animejs": "^3.0.1",
57-
"body-parser": "^1.18.3",
57+
"body-parser": "^1.19.0",
5858
"cross-env": "^5.2.0",
59-
"express": "^4.16.4",
59+
"express": "^4.17.1",
6060
"js-cookie": "^2.2.0",
6161
"moment": "^2.24.0",
62-
"nuxt": "^2.6.2",
62+
"nuxt": "^2.8.0",
6363
"nuxt-client-init-module": "^0.1.4",
6464
"nuxt-env": "^0.1.0",
6565
"nuxt-property-decorator": "^2.1.3",
6666
"throttle-debounce": "^2.1.0",
67-
"ts-node": "^8.1.0",
67+
"ts-node": "^8.2.0",
6868
"vue-carousel": "^0.18.0",
69-
"vue-i18n": "^8.10.0",
69+
"vue-i18n": "^8.11.2",
7070
"vue-lazyload": "^1.2.6"
7171
},
7272
"devDependencies": {
7373
"@nuxtjs/eslint-config": "^0.0.1",
7474
"@nuxtjs/style-resources": "^0.1.2",
75-
"@storybook/vue": "^5.0.9",
75+
"@storybook/vue": "^5.0.11",
7676
"@types/animejs": "^2.0.2",
7777
"@types/babel-core": "6.25.6",
7878
"@types/eslint": "^4.16.6",
7979
"@types/eslint-plugin-prettier": "2.2.0",
8080
"@types/express": "^4.16.1",
81-
"@types/jest": "^24.0.11",
81+
"@types/jest": "^24.0.13",
8282
"@types/js-cookie": "^2.2.2",
8383
"@types/moment": "^2.13.0",
84-
"@types/prettier": "1.16.2",
84+
"@types/prettier": "1.16.4",
8585
"@types/storybook__vue": "^5.0.1",
86-
"@typescript-eslint/eslint-plugin": "^1.6.0",
87-
"@typescript-eslint/parser": "^1.6.0",
86+
"@typescript-eslint/eslint-plugin": "^1.9.0",
87+
"@typescript-eslint/parser": "^1.9.0",
8888
"@vue/test-utils": "^1.0.0-beta.29",
8989
"babel-core": "7.0.0-bridge.0",
9090
"babel-eslint": "^10.0.1",
91-
"babel-jest": "^24.7.1",
91+
"babel-jest": "^24.8.0",
9292
"babel-preset-vue": "^2.0.2",
9393
"eslint": "^5.16.0",
94-
"eslint-config-prettier": "^4.1.0",
94+
"eslint-config-prettier": "^4.3.0",
9595
"eslint-config-standard": ">=12.0.0",
9696
"eslint-loader": "^2.1.2",
97-
"eslint-plugin-import": ">=2.17.2",
98-
"eslint-plugin-jest": ">=22.4.1",
99-
"eslint-plugin-node": ">=8.0.1",
100-
"eslint-plugin-prettier": "3.0.1",
97+
"eslint-plugin-import": ">=2.17.3",
98+
"eslint-plugin-jest": ">=22.6.4",
99+
"eslint-plugin-node": ">=9.1.0",
100+
"eslint-plugin-prettier": "3.1.0",
101101
"eslint-plugin-promise": ">=4.1.1",
102102
"eslint-plugin-standard": ">=4.0.0",
103103
"eslint-plugin-vue": "^5.2.2",
104-
"husky": "^1.3.1",
105-
"jest": "^24.7.1",
106-
"node-sass": "^4.11.0",
107-
"nodemon": "^1.18.11",
108-
"prettier": "1.17.0",
104+
"husky": "^2.3.0",
105+
"jest": "^24.8.0",
106+
"node-sass": "^4.12.0",
107+
"nodemon": "^1.19.1",
108+
"prettier": "1.17.1",
109109
"pug": "^2.0.3",
110110
"pug-plain-loader": "^1.0.0",
111111
"rimraf": "^2.6.3",
File renamed without changes.

src/pages/example/img-lazy-load.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ section
1616

1717
<script lang="ts">
1818
import { Component, Vue } from 'nuxt-property-decorator'
19-
import LazyImage from '@/components/LazyImage.vue'
19+
import LazyImage from '@/components/partials/lazyImage/LazyImage.vue'
2020
2121
@Component({
2222
components: {
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/plugins/i18n.ts renamed to src/plugins/locale/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default ({ app, store }): void => {
1414
locale: store.state.i18n.locale,
1515
fallbackLocale: 'ja',
1616
messages: {
17-
ja: require('~/locales/ja.json')
17+
ja: require('@/locales/ja.json')
1818
}
1919
})
2020

tsconfig.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,35 @@
22
"compilerOptions": {
33
"allowJs": true,
44
"baseUrl": ".",
5+
"esModuleInterop": true,
56
"experimentalDecorators": true,
67
"lib": [
7-
"dom",
8-
"es2015",
9-
"es2017"
8+
"esnext",
9+
"esnext.asynciterable",
10+
"dom"
1011
],
1112
"module": "esnext",
1213
"moduleResolution": "node",
13-
"noImplicitThis": true,
1414
"paths": {
1515
"@/*": [
1616
"src/*"
1717
],
1818
"~/*": [
19-
"./*"
20-
],
21-
"*": [
22-
"types/*"
19+
"src/*"
2320
]
2421
},
22+
"removeComments": true,
2523
"sourceMap": true,
2624
"strictNullChecks": true,
27-
"strictPropertyInitialization": false,
28-
"target": "es5",
25+
"noImplicitThis": true,
26+
"target": "esnext",
2927
"types": [
3028
"@types/node",
3129
"@types/jest",
3230
"@types/webpack",
3331
"@nuxt/vue-app"
3432
],
35-
"esModuleInterop": true,
36-
"strict": true,
33+
"strict": false,
3734
"noImplicitAny": false,
3835
"noEmit": true
3936
},
@@ -46,3 +43,4 @@
4643
"stories"
4744
]
4845
}
46+

0 commit comments

Comments
 (0)