careful-book-62830
11/01/2022, 8:37 PMpulumi
itself. Is there a way to not use module: "commonjs"
defined in here ?Thank you in advanceError: Cannot find module './config.js'
whenever I do import
import * as config from './config.js';
Pulumi.yaml
name: test
runtime: nodejs
description: A minimal Azure NextGen TypeScript Pulumi program
main: src/index.ts
options:
# See <https://github.com/TypeStrong/ts-node/issues/1007>
nodeargs: "--loader ts-node/esm --no-warnings"
main
to dist/index.js
then I get another error from pulumi:
Error [ERR_REQUIRE_ESM]: require() of ES Module/ dist/index.js from /node_modules/@pulumi/pulumi/cmd/run/run.js not supported.
Instead change the require of index.js in /node_modules/@pulumi/pulumi/cmd/run/run.js to a dynamic import() which is available in all CommonJS modules.