use route name now with updated strucutre

Thanks @rschamp for this!
This commit is contained in:
Matthew Taylor 2016-04-21 18:16:49 -04:00
parent 2eb62e8ab3
commit bf1a99fd63
2 changed files with 3 additions and 3 deletions
bin
mustache-renderer-webpack-plugin

View file

@ -82,7 +82,7 @@ var getConditionNameForRoute = function (route, type) {
};
var getHeaderNameForRoute = function (route) {
if (route.view) return 'rewrites/' + route.view;
if (route.name) return 'rewrites/' + route.name;
if (route.redirect) return 'redirects/' + route.pattern;
};
@ -234,7 +234,7 @@ async.auto({
ignore_if_set: 0,
type: 'REQUEST',
dst: 'url',
src: '"/' + route.view + '.html"',
src: '"/' + route.name + '.html"',
request_condition: results.appRouteRequestConditions[id].name,
priority: 10
};

View file

@ -30,7 +30,7 @@ MustacheRendererPlugin.prototype.apply = function (compiler) {
compiler.plugin('emit', function (compilation, callback) {
var outputRoutes = {};
routes.forEach(function (route) {
var filename = route.view + '.html';
var filename = route.name + '.html';
var content = render(template, route, config);
outputRoutes[route.pattern] = filename;
compilation.assets[filename] = {