Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

feat: add rendering mode #10

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
root = true

[*]
indent_style = tab
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml,*.md}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"authors": [
"Egoist <[email protected]>",
"Nuxt team <[email protected]>",
"Clark Du"
"Clark Du <[email protected]>"
],
"license": "MIT"
}
9 changes: 9 additions & 0 deletions sao.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ module.exports = {
],
default: 'none'
},
mode: {
message: 'Choose rendering mode',
type: 'list',
choices: [
{name: 'Universal', value: 'universal'},
{name: 'Single Page App', value: 'spa'}
],
default: 'universal'
},
axios: {
message: 'Use axios module',
type: 'list',
Expand Down
7 changes: 3 additions & 4 deletions template/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
root = true

[*]
indent_style = tab
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml,*.md}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
4 changes: 2 additions & 2 deletions template/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ module.exports = {
],
// add your custom rules here
rules: {
'space-before-function-paren': [
'space-before-function-paren': [
2,
{
anonymous: 'always',
named: 'never'
}
],
},
},
globals: {}
}
43 changes: 22 additions & 21 deletions template/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const pkg = require('./package')

module.exports = {
mode: "<%= mode %>",
/*
** Headers of the page
*/
Expand Down Expand Up @@ -29,32 +30,32 @@ module.exports = {
'~/assets/css/tailwind.css'<% } %>
],

/*
** Plugins to load before mounting the App
*/
/*
** Plugins to load before mounting the App
*/
plugins: [<% if (ui === 'element-ui') { %>
'@/plugins/element-ui'<% } else if (ui === 'vuetify') { %>
'@/plugins/vuetify'<% } %>
],

/*
** Nuxt.js modules
*/
/*
** Nuxt.js modules
*/
modules: [<% if (axios === 'yes') { %>
// Doc: https://github.com/nuxt-community/axios-module#usage
'@nuxtjs/axios'<% } %><% if (ui === 'bootstrap') { %>,
// Doc: https://bootstrap-vue.js.org/docs/
'bootstrap-vue/nuxt'<% } %><% if (ui === 'bulma') { %>,
// Doc:https://github.com/nuxt-community/modules/tree/master/packages/bulma
'@nuxtjs/bulma'<% } %>
// Doc:https://github.com/nuxt-community/modules/tree/master/packages/bulma
'@nuxtjs/bulma'<% } %>
],<% if (axios === 'yes') { %>

/*
** Axios module configuration
*/
/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
},<% } %>
},<% } %>

/*
** Build configuration
Expand All @@ -64,15 +65,15 @@ module.exports = {
** You can extend webpack config here
*/
extend (config, ctx) {
<% if (eslint === 'yes') { %>// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}<% } %>
<% if (eslint === 'yes') { %>// Run ESLint on save
if (ctx.isDev && ctx.isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}<% } %>
}
}
}