From cc1cb2f815f6fc7dbd7710e82856d49d704cb130 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Apr 2026 19:52:59 -0400
Subject: [PATCH 1/3] Enable classicEmberSupport() for compat-build scenarios
The min-supported, ember-lts-4.12, and ember-lts-5.12 try-scenarios all
set ENABLE_COMPAT_BUILD=true and install @embroider/compat + ember-auto-import
so they can exercise the classic Ember 4.x/5.12 resolution path. The compat
scenario was failing with:
[vite]: Rollup failed to resolve import "ember-testing" from
"test-app/tests/index.html?html-proxy&index=0.js".
`tests/index.html` has ``
which is a bare specifier that needs the classic resolver. In the default
build, `ember()` is enough, but the compat path requires
`classicEmberSupport()` (see ef4/memory-scroll vite.config.mjs for the
reference pattern).
Spread `classicEmberSupport()` into plugins only when ENABLE_COMPAT_BUILD is
set, matching the pattern already used by the try scenarios themselves.
Co-Authored-By: Claude Opus 4.7 (1M context)
---
test-app/vite.config.mjs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test-app/vite.config.mjs b/test-app/vite.config.mjs
index 5401cd2..90d625f 100644
--- a/test-app/vite.config.mjs
+++ b/test-app/vite.config.mjs
@@ -1,9 +1,10 @@
import { defineConfig } from 'vite';
-import { extensions, ember, hbs } from '@embroider/vite';
+import { extensions, ember, hbs, classicEmberSupport } from '@embroider/vite';
import { babel } from '@rollup/plugin-babel';
export default defineConfig({
plugins: [
+ ...(process.env.ENABLE_COMPAT_BUILD ? [classicEmberSupport()] : []),
hbs(),
ember(),
babel({
From 3f87e2b3baa8b16cd313f78eaee2efeecf829296 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Apr 2026 20:01:03 -0400
Subject: [PATCH 2/3] Write ember-cli-build as .cjs in compat scenarios
test-app/package.json has "type": "module", so an ember-cli-build.js file
would be parsed as ESM. The generated content is CommonJS (require /
module.exports), so the file needs a .cjs extension to be interpreted
correctly.
Co-Authored-By: Claude Opus 4.7 (1M context)
---
test-app/.try.mjs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test-app/.try.mjs b/test-app/.try.mjs
index 7acc66f..ac98e56 100644
--- a/test-app/.try.mjs
+++ b/test-app/.try.mjs
@@ -1,6 +1,6 @@
// When building your addon for older Ember versions you need to have the required files
const compatFiles = {
- 'ember-cli-build.js': `const EmberApp = require('ember-cli/lib/broccoli/ember-app');
+ 'ember-cli-build.cjs': `const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { compatBuild } = require('@embroider/compat');
module.exports = async function (defaults) {
const { buildOnce } = await import('@embroider/vite');
From 35ccbed5a2bb21948e30bbb51bc4fd0921726a85 Mon Sep 17 00:00:00 2001
From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Date: Sat, 18 Apr 2026 20:03:33 -0400
Subject: [PATCH 3/3] Update vite.config.mjs
---
test-app/vite.config.mjs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/test-app/vite.config.mjs b/test-app/vite.config.mjs
index 90d625f..417b5fb 100644
--- a/test-app/vite.config.mjs
+++ b/test-app/vite.config.mjs
@@ -4,8 +4,7 @@ import { babel } from '@rollup/plugin-babel';
export default defineConfig({
plugins: [
- ...(process.env.ENABLE_COMPAT_BUILD ? [classicEmberSupport()] : []),
- hbs(),
+ ...(process.env.ENABLE_COMPAT_BUILD ? [classicEmberSupport()] : [hbs()]),
ember(),
babel({
babelHelpers: 'runtime',