beyerleinf / esbuild-azure-functions

A ✨blazingly fast✨ builder for Azure Functions powered by esbuild.
MIT License
12 stars 2 forks source link

Plugins should not add code to sourcemap files #11

Closed beyerleinf closed 2 years ago

beyerleinf commented 2 years ago

Currently, sourcemap files also get modified by plugins, resulting in weird sourcemaps.

Example:

import __azf_shim_import_PATH from 'path';
import __azf_shim_import_URL from 'url'

const __dirname = __azf_shim_import_PATH.dirname(__azf_shim_import_URL.fileURLToPath(import.meta.url));
const __filename = __azf_shim_import_URL.fileURLToPath(import.meta.url);

import __azf_shim_import_MODULE from 'module';

const require = __azf_shim_import_MODULE.createRequire(import.meta.url);

{
  "version": 3,
  ...
}