mirror of
https://github.com/actions/configure-pages.git
synced 2025-12-08 16:16:09 +00:00
Do a bit more configuration for nuxt, set server = 'static'
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
An action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as [starter workflows][starter-workflows].
|
||||
|
||||
See [`set-pages-path.js`](./src/set-pages-path.js) for more details on how we configure static site generators to work "out of the box" with GitHub Pages.
|
||||
|
||||
# Usage
|
||||
|
||||
See [action.yml](action.yml) and the [Pages starter workflows][starter-workflows].
|
||||
|
||||
18
dist/index.js
vendored
18
dist/index.js
vendored
@@ -14468,7 +14468,7 @@ class ConfigParser {
|
||||
|
||||
// If the configuration file does not exist, initialize it with the blank configuration file
|
||||
if (!fs.existsSync(this.configurationFile)) {
|
||||
core.info('Use default blank configuration')
|
||||
core.info('Using default blank configuration')
|
||||
const blankConfiguration = fs.readFileSync(blankConfigurationFile, 'utf8')
|
||||
fs.writeFileSync(this.configurationFile, blankConfiguration, {
|
||||
encoding: 'utf8'
|
||||
@@ -14476,7 +14476,6 @@ class ConfigParser {
|
||||
}
|
||||
|
||||
// Read the configuration file
|
||||
core.info('Read existing configuration')
|
||||
this.configuration = fs.readFileSync(this.configurationFile, 'utf8')
|
||||
}
|
||||
|
||||
@@ -14592,7 +14591,8 @@ class ConfigParser {
|
||||
// - propertyValue: the value of the property
|
||||
inject(propertyName, propertyValue) {
|
||||
// Logging
|
||||
core.info(`Parsing configuration:\n${this.configuration}`)
|
||||
core.info(`Injecting property=${propertyName} and value=${propertyValue} in:`)
|
||||
core.info(this.configuration)
|
||||
|
||||
// Parse the AST out of the configuration file
|
||||
const espreeOptions = {
|
||||
@@ -14693,7 +14693,8 @@ class ConfigParser {
|
||||
}
|
||||
|
||||
// Logging
|
||||
core.info(`Writing new configuration:\n${this.configuration}`)
|
||||
core.info(`Injection successful, new configuration:`)
|
||||
core.info(this.configuration)
|
||||
|
||||
// Finally write the new configuration in the file
|
||||
fs.writeFileSync(this.configurationFile, this.configuration, {
|
||||
@@ -14836,7 +14837,12 @@ function getConfigParserSettings(staticSiteGenerator, path) {
|
||||
configurationFile: './nuxt.config.js',
|
||||
blankConfigurationFile: __nccwpck_require__.ab + "nuxt.js",
|
||||
properties: {
|
||||
'router.base': path
|
||||
// Configure a base path on the router
|
||||
'router.base': path,
|
||||
|
||||
// Set the target to static too
|
||||
// https://nuxtjs.org/docs/configuration-glossary/configuration-target/
|
||||
server: 'static'
|
||||
}
|
||||
}
|
||||
case 'next':
|
||||
@@ -14849,6 +14855,7 @@ function getConfigParserSettings(staticSiteGenerator, path) {
|
||||
configurationFile: './next.config.js',
|
||||
blankConfigurationFile: __nccwpck_require__.ab + "next.js",
|
||||
properties: {
|
||||
// Configure a base path
|
||||
basePath: path,
|
||||
|
||||
// Disable server side image optimization too
|
||||
@@ -14861,6 +14868,7 @@ function getConfigParserSettings(staticSiteGenerator, path) {
|
||||
configurationFile: './gatsby-config.js',
|
||||
blankConfigurationFile: __nccwpck_require__.ab + "gatsby.js",
|
||||
properties: {
|
||||
// Configure a path prefix
|
||||
pathPrefix: path
|
||||
}
|
||||
}
|
||||
|
||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -38,7 +38,7 @@ class ConfigParser {
|
||||
|
||||
// If the configuration file does not exist, initialize it with the blank configuration file
|
||||
if (!fs.existsSync(this.configurationFile)) {
|
||||
core.info('Use default blank configuration')
|
||||
core.info('Using default blank configuration')
|
||||
const blankConfiguration = fs.readFileSync(blankConfigurationFile, 'utf8')
|
||||
fs.writeFileSync(this.configurationFile, blankConfiguration, {
|
||||
encoding: 'utf8'
|
||||
@@ -46,7 +46,6 @@ class ConfigParser {
|
||||
}
|
||||
|
||||
// Read the configuration file
|
||||
core.info('Read existing configuration')
|
||||
this.configuration = fs.readFileSync(this.configurationFile, 'utf8')
|
||||
}
|
||||
|
||||
@@ -162,7 +161,8 @@ class ConfigParser {
|
||||
// - propertyValue: the value of the property
|
||||
inject(propertyName, propertyValue) {
|
||||
// Logging
|
||||
core.info(`Parsing configuration:\n${this.configuration}`)
|
||||
core.info(`Injecting property=${propertyName} and value=${propertyValue} in:`)
|
||||
core.info(this.configuration)
|
||||
|
||||
// Parse the AST out of the configuration file
|
||||
const espreeOptions = {
|
||||
@@ -263,7 +263,8 @@ class ConfigParser {
|
||||
}
|
||||
|
||||
// Logging
|
||||
core.info(`Writing new configuration:\n${this.configuration}`)
|
||||
core.info(`Injection successful, new configuration:`)
|
||||
core.info(this.configuration)
|
||||
|
||||
// Finally write the new configuration in the file
|
||||
fs.writeFileSync(this.configurationFile, this.configuration, {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Default Pages configuration for Nuxt
|
||||
export default {router: {base: '/docs/'}}
|
||||
export default {server: 'static', router: {base: '/docs/'}}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export default {
|
||||
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
||||
server: 'static',
|
||||
router: { base: "/docs/" },
|
||||
ssr: false,
|
||||
|
||||
|
||||
@@ -10,7 +10,12 @@ function getConfigParserSettings(staticSiteGenerator, path) {
|
||||
configurationFile: './nuxt.config.js',
|
||||
blankConfigurationFile: `${__dirname}/blank-configurations/nuxt.js`,
|
||||
properties: {
|
||||
'router.base': path
|
||||
// Configure a base path on the router
|
||||
'router.base': path,
|
||||
|
||||
// Set the target to static too
|
||||
// https://nuxtjs.org/docs/configuration-glossary/configuration-target/
|
||||
server: 'static'
|
||||
}
|
||||
}
|
||||
case 'next':
|
||||
@@ -23,6 +28,7 @@ function getConfigParserSettings(staticSiteGenerator, path) {
|
||||
configurationFile: './next.config.js',
|
||||
blankConfigurationFile: `${__dirname}/blank-configurations/next.js`,
|
||||
properties: {
|
||||
// Configure a base path
|
||||
basePath: path,
|
||||
|
||||
// Disable server side image optimization too
|
||||
@@ -35,6 +41,7 @@ function getConfigParserSettings(staticSiteGenerator, path) {
|
||||
configurationFile: './gatsby-config.js',
|
||||
blankConfigurationFile: `${__dirname}/blank-configurations/gatsby.js`,
|
||||
properties: {
|
||||
// Configure a path prefix
|
||||
pathPrefix: path
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user