angular/packages/service-worker/cli/esbuild.config.js
Joey Perrott 7dcae7b5e2 build: migrate service-worker package to use ts_project (#61226)
Migrate the package to using rules_js

PR Close #61226
2025-05-12 15:29:29 -07:00

22 lines
763 B
JavaScript

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
module.exports = {
// TODO: Investigate if this can be removed once ng_module is migrated to ng_project
resolveExtensions: ['.mjs', '.js'],
// Note: `@bazel/esbuild` has a bug and does not pass-through the format from Starlark.
format: 'esm',
banner: {
// Workaround for: https://github.com/evanw/esbuild/issues/946
// TODO: Remove this workaround in the future once devmode is ESM as well.
js: `
import {createRequire as __cjsCompatRequire} from 'module';
const require = __cjsCompatRequire(import.meta.url);
`,
},
};