https://github.com/jorgevrgs/sails-hook-nuxt
Nuxt.js hook for Sails.js
https://github.com/jorgevrgs/sails-hook-nuxt
nuxt nuxtjs sails-hook sailsjs vue
Last synced: 2 months ago
JSON representation
Nuxt.js hook for Sails.js
- Host: GitHub
- URL: https://github.com/jorgevrgs/sails-hook-nuxt
- Owner: jorgevrgs
- Created: 2021-03-15T12:19:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-28T02:13:50.000Z (almost 3 years ago)
- Last Synced: 2025-02-26T17:49:12.413Z (3 months ago)
- Topics: nuxt, nuxtjs, sails-hook, sailsjs, vue
- Language: JavaScript
- Homepage:
- Size: 1.44 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sails-hook-nuxt - Nuxt for Sails.js v1
## Installation
```
npm i sails-hook-nuxt
```
[](https://github.com/jorgevrgs/sails-hook-nuxt/actions/workflows/npm-publish.yml)
## How to use
- Create a config file `config/nuxt.js` with content `module.exports.nuxt = {}` with the content of your `nuxt.config.js` file. See [Config section](#config)
- Create a folder `client` in your Sails app path.
- Use as usual to set there the Nuxt files, i.e. `client/pages/index.vue`
- Run the Sails app with `sails lift`.
- Open your server in the browser `http://localhost:1337`
- To avoid building Nuxt for other scripts disable the hook setting at `.sailsrc`with the value `"{ hooks: {"nuxt": false} }` or the env variable, i.e. `sails_hooks__nuxt=false sails run rebuild-cloud-sdk`.Check the `example` folder for more info.
## Config
### Default
The default configuration sets only the value of `srcDir` to `client/` folder.
```js
module.exports = {
srcDir: 'client'
}
```### Sails config
Create a config/nuxt file:
```js
module.exports.nuxt = {
// ... nuxt.config.js content
};
```### Nuxt.config.js
Alternatively, to preserve the nuxt.config.js file:
Create a nuxt.config.js file
```js
// nuxt.config.js
module.exports = {
// ... confing content
};
``````js
// config/nuxt.js
module.exports.nuxt = require('../nuxt.config');
```## Eslint
Configure your eslint file in the cliente folder. Check example folder for more information.
```
npm i -D @nuxtjs/eslint-config
```Create a file `client/.eslintrc`
```
{
"extends": ["@nuxtjs"]
}
```