Fix adapter-node build in presence of tsconfig.json
* target Node 12 in app output
Without an explicit target value, esbuild will pick up the version from
tsconfig.json, if present. This breaks the build if that specifies a
target of es2019, which does not support import.meta.
* add changeset
ADD
.changeset/wild-pumas-jam.md
+---
+'@sveltejs/adapter-node': patch
+---
+
+Fix build when using TypeScript and there is a `tsconfig.json` with `target: 'es2019'` or earlier

MODIFY
packages/adapter-node/index.js
packages/adapter-node/index.js
@@ -28,7 +28,8 @@ export default function ({ out = 'build' } = {}) {
bundle: true,
external: Object.keys(JSON.parse(readFileSync('package.json', 'utf8')).dependencies || {}),
format: 'esm',
- platform: 'node'
+ platform: 'node',
+ target: 'node12'
});
utils.log.minor('Prerendering static pages');

Fix adapter-node build in presence of tsconfig.json (#1675)

* target Node 12 in app output

Without an explicit target value, esbuild will pick up the version from
tsconfig.json, if present. This breaks the build if that specifies a
target of es2019, which does not support import.meta.

* add changeset