Last active
April 11, 2016 19:01
-
-
Save mattcroberts/495475ee547d2a17494c to your computer and use it in GitHub Desktop.
Allow multiple index files with ember-cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var configReplace = require('ember-cli/lib/broccoli/broccoli-config-replace'); | |
var path = require('path'); | |
var funnel = require('broccoli-funnel'); | |
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); | |
var app = new EmberApp({ | |
fingerprint: { | |
extensions: ['js', 'css'], | |
replaceExtensions: ['jsp', 'html'] | |
} | |
}); | |
app.index = function (){ | |
var files = ['index.html', 'index.jsp']; | |
var index = funnel('app', { | |
files: files | |
}); | |
return configReplace(index, this._configTree(), { | |
configPath: path.join(this.name, 'config', 'environments', this.env + '.json'), | |
files: files, | |
patterns: this._configReplacePatterns() | |
}); | |
}; | |
module.exports = app.toTree(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing! I'm experimenting with building different
index.html
s (one for moible, one for desktop) and found this helpful for testing out the idea.