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
babel: { | |
presets: [ | |
'es2015', | |
'stage-0' | |
], | |
plugins: [ | |
['transform-runtime', { | |
'polyfill': true, | |
'regenerator': true, | |
}] |
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
$ # make sure you're in src directory | |
$ # run the app in localhost | |
$ yarn dev |
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
publicPath: '/public/', | |
vendor: ['axios'], | |
extractCSS: true, |
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
$ # edit the file | |
$ vi nuxt.config.js |
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
$ # make sure you're in src directory | |
$ # install babel plugins | |
$ yarn add -D babel-plugin-module-resolver babel-plugin-transform-runtime babel-preset-es2015 babel-preset-stage-0 | |
$ # edit the file | |
$ vi nuxt.config.js |
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
$ # make sure you're in src | |
$ # run the app in localhost | |
$ yarn dev |
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
$ # make sure you're in src directory | |
$ # In the video, he's using isomorphic-fetch | |
$ # However, Nuxt.js strongly recommends using axios, so here we go | |
$ yarn add axios | |
$ # Clear index.vue and edit the file | |
$ echo '' > pages/index.vue && vi pages/index.vue |
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
$ # install vue-cli and yarn | |
$ sudo npm i -g vue-cli yarn | |
$ # Create Nuxt app project in src directory based on nuxt-community/starter-template | |
$ vue init nuxt-community/starter-template src | |
$ # The answer can be all default | |
- ? Generate project in current directory? | |
- ? Project name | |
- ? Project description | |
- ? ? Author | |
$ # move to src directory, then install npm packages |
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
$ # Create a project directory, then move into it | |
$ mkdir <proj> && cd $_ |
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
$ # プロジェクト用のフォルダ(<proj>、任意に決めてください)を作って、そのフォルダの中へ移動。 | |
$ mkdir <proj> && cd $_ |