Commit 77fc98ff by Иван Кубота

Routing smallfix

parent e2a01b58
const maps = true
var env = process.env; var env = process.env;
const compression = require('compression') const compression = require('compression')
...@@ -74,7 +76,7 @@ var transformJSX = function(code, fileName, cb) { ...@@ -74,7 +76,7 @@ var transformJSX = function(code, fileName, cb) {
//[simpleTransformToAMD] //[simpleTransformToAMD]
['@babel/plugin-transform-modules-amd'] ['@babel/plugin-transform-modules-amd']
], ],
sourceMaps: 'both', sourceMaps: maps,
sourceFileName: fileName, sourceFileName: fileName,
moduleId: fileName moduleId: fileName
}, function( c, d, e ){ }, function( c, d, e ){
...@@ -154,7 +156,7 @@ var transformServe = function(dir, anything) { ...@@ -154,7 +156,7 @@ var transformServe = function(dir, anything) {
sass.render( { sass.render( {
data: data+'', data: data+'',
file: path.join( __dirname, dir, req.url ), file: path.join( __dirname, dir, req.url ),
sourceMap: true, sourceMap: maps,
importer: function( url, prev, done ){ importer: function( url, prev, done ){
if(url[0] === '/'){ if(url[0] === '/'){
url = path.join( __dirname, dir, url.substr(1)); url = path.join( __dirname, dir, url.substr(1));
...@@ -265,7 +267,7 @@ var transformServe = function(dir, anything) { ...@@ -265,7 +267,7 @@ var transformServe = function(dir, anything) {
} ], } ],
['@babel/plugin-transform-modules-amd'] ['@babel/plugin-transform-modules-amd']
], ],
sourceMaps: 'both', sourceMaps: maps,
sourceFileName: req.url, sourceFileName: req.url,
moduleId: req.url moduleId: req.url
}, function( err, result ){ }, function( err, result ){
......
...@@ -16,6 +16,7 @@ const ACTION = { ...@@ -16,6 +16,7 @@ const ACTION = {
}); });
if(!silent){ if(!silent){
Model.history.push( { current: where, data: data || {} } ); Model.history.push( { current: where, data: data || {} } );
//debugger
history.pushState( { place: where, data: data || {} }, '', Page[ where ].route.generate( data || {} ) ); history.pushState( { place: where, data: data || {} }, '', Page[ where ].route.generate( data || {} ) );
} }
}), }),
...@@ -43,7 +44,7 @@ const ACTION = { ...@@ -43,7 +44,7 @@ const ACTION = {
ACTION.NAVIGATE.execute('WelcomeDemoFinalLastNotification'); ACTION.NAVIGATE.execute('WelcomeDemoFinalLastNotification');
}), }),
GOTO_FINAL_TEST: new Action(()=>{ GOTO_FINAL_TEST: new Action(()=>{
ACTION.NAVIGATE.execute('WelcomeDemoFinalLastNotification'); ACTION.NAVIGATE.execute('DemoTesting');
}), }),
LIMITLESS: new Action(()=>{ LIMITLESS: new Action(()=>{
......
...@@ -28,9 +28,9 @@ Route.prototype = { ...@@ -28,9 +28,9 @@ Route.prototype = {
splitted = this.splitted, splitted = this.splitted,
out = []; out = [];
for( var i = 0, _i = list.length; i < _i; i++ ){ for( var i = 0, _i = splitted.length; i < _i; i++ ){
out.push(splitted[i]); out.push(splitted[i]);
out.push(data[list[i]] || ''); i<_i-1 && out.push(data[list[i]] || '');
} }
return out.join(''); return out.join('');
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment