Skip to content

Commit 3f87e2b

Browse files
NullVoxPopuliclaude
andcommitted
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) <[email protected]>
1 parent cc1cb2f commit 3f87e2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

test-app/.try.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// When building your addon for older Ember versions you need to have the required files
22
const compatFiles = {
3-
'ember-cli-build.js': `const EmberApp = require('ember-cli/lib/broccoli/ember-app');
3+
'ember-cli-build.cjs': `const EmberApp = require('ember-cli/lib/broccoli/ember-app');
44
const { compatBuild } = require('@embroider/compat');
55
module.exports = async function (defaults) {
66
const { buildOnce } = await import('@embroider/vite');

0 commit comments

Comments
 (0)