Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { ember as emberVite, extensions } from "@embroider/vite";
import { babel } from "@rollup/plugin-babel";
import { buildMacros } from "@embroider/macros/babel";

const macros = buildMacros();

function getRenderer() {
return {
name: "ember-astro",
Expand All @@ -19,7 +17,14 @@ export function getContainerRenderer() {
};
}

function emberIntegration(/* options */) {
function emberIntegration(options = {}) {
// Forward a `configure` callback to buildMacros so consumers can register
// Embroider macros global config (e.g. WarpDrive/ember-data via `setConfig`).
// Needed when compiling apps/libs gated on `getGlobalConfig().<pkg>.env` —
// without it the build throws on that value being undefined. Omitting
// `configure` is identical to the previous `buildMacros()` call.
const macros = buildMacros({ configure: options.configure });

return {
name: "ember-astro",
hooks: {
Expand Down