Hi there.
I’m currently in the process of upgrading our Ember app from Ember version 2.18 to the most recent version.
Our app is using different templates for desktop or mobile based on a build flag. We change the app’s template directory in ember-cli-build.js
, but our current approach doesn’t seem to work anymore.
The app is currently on Ember CLI version 3.4.4, but I also tried the same with a completely new Ember app using Ember CLI version 3.18.0.
Here’s the ember-cli-build.js
, reduced to the bare minimum that reproduces the problem:
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const path = require('path');
const { UnwatchedDir } = require('broccoli-source');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
});
const mobileTemplates = new UnwatchedDir(path.join(__dirname, 'app/templates/mobile'));
app.options.trees.templates = mobileTemplates;
return app.toTree();
};
When starting the app, the screen just stays white, not rendering anything.
Any pointers what I’m doing wrong here? Is there a new way to achieve this?