Update config parser to support export default with identifier and add SvelteKit code

Co-authored-by: NatoBoram <natoboram@users.noreply.github.com>
This commit is contained in:
AndrewLester
2022-08-09 20:26:30 -04:00
parent c61e34fb27
commit c872edcdfb
11 changed files with 81 additions and 6 deletions

18
dist/index.js vendored
View File

@@ -14578,8 +14578,8 @@ class ConfigParser {
}
// Find the configuration object in an AST.
// Look for a default export, a direct module export or an indirect module
// export (in that order).
// Look for a default export, an export default with idenfitier, a direct module export
// or an indirect module export (in that order).
//
// Return the configuration object or null.
findConfigurationObject(ast) {
@@ -14908,6 +14908,20 @@ function getConfigParserSettings({ staticSiteGenerator, generatorConfigFile, pat
pathPrefix: path
}
}
case 'sveltekit':
// SvelteKit does not want a trailing slash
if (path.endsWith('/')) {
path = path.slice(0, -1)
}
return {
configurationFile: './svelte.config.js',
blankConfigurationFile: __nccwpck_require__.ab + "sveltekit.js",
properties: {
// Configure a base path
'kit.paths.base': path
}
}
default:
throw `Unsupported static site generator: ${staticSiteGenerator}`
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

8
dist/sveltekit.js vendored Normal file
View File

@@ -0,0 +1,8 @@
// Default Pages configuration for SvelteKit
import adapter from '@sveltejs/adapter-auto'
export default {
kit: {
adapter: adapter()
}
}