Skip to content

Commit c6f42ea

Browse files
author
Robert Jackson
authored
Ensure "pods style" templates are compiled properly. (#332)
Ensure "pods style" templates are compiled properly.
2 parents 1e6755e + 3430b20 commit c6f42ea

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

lib/colocated-broccoli-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module.exports = class ColocatedTemplateProcessor extends Plugin {
7373
let hasJSFile = fs.existsSync(path.join(this.inputPaths[0], possibleJSPath));
7474

7575
if (filePathParts.name === 'template') {
76-
// TODO: maybe warn?
76+
filesToCopy.push(filePath);
7777
return;
7878
}
7979

node-tests/colocated-plugin-test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,29 @@ describe('ColocatedTemplateCompiler', function() {
227227
assert.deepStrictEqual(output.read(), input.read());
228228
});
229229

230+
it('does nothing for "pod" location templates', async function() {
231+
input.write({
232+
'addon-name-here': {
233+
components: {
234+
foo: {
235+
'template.hbs': `{{yield}}`,
236+
},
237+
},
238+
},
239+
});
240+
241+
let tree = new ColocatedTemplateCompiler(input.path(), {
242+
precompile(template) {
243+
return JSON.stringify({ template });
244+
},
245+
});
246+
247+
output = createBuilder(tree);
248+
await output.build();
249+
250+
assert.deepStrictEqual(output.read(), input.read());
251+
});
252+
230253
it('it works if there are no input files', async function() {
231254
input.write({});
232255

0 commit comments

Comments
 (0)