Skip to content

Commit

Permalink
fix: .cjs and destructure of undefined (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthegedus authored Feb 7, 2021
1 parent ed2acd3 commit 5be6798
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 0.3.0 (2021-02-07)

- fix: cjs output from sveltekit requires rename of local require in handler.js
- fix: destructure of undefined in index.js.adapter(). Fixes #5

## 0.2.0 (2021-01-06)

- chore: build with microbundle instead of Rollup directly
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"source": "src/index.js",
"main": "dist/index.js",
"version": "0.2.3",
"version": "0.3.0",
"dependencies": {
"@sveltejs/app-utils": "1.0.0-next.0",
"joi": "^17.3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/files/handler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {get_body: getBody} = require('@sveltejs/app-utils/http');
const app = require('./app.js');
const app = require('./app.cjs');

exports.sveltekitServer = async (request, response) => {
const {pathname, query = ''} = new URL(
Expand Down
11 changes: 6 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ function getFile(filepath) {

async function adapter(
builder,
{
hostingSite,
parameters
) {
const {
hostingSite = null,
sourceRewriteMatch = '**',
firebaseJson = 'firebase.json',
cloudRunBuildDir
}
) {
cloudRunBuildDir = null
} = parameters;
// Joi.array.single converts the hosting field to an array if a single item is provided
const firebaseConfig = validateFirebaseConfig(
firebaseJson,
Expand Down

0 comments on commit 5be6798

Please sign in to comment.