2
0
Fork 0

Fixed example script path

This commit is contained in:
Willem 2016-01-18 02:06:24 +01:00
parent 471c6add4d
commit 6d9869fb85
4 changed files with 9 additions and 10 deletions

View file

@ -7,7 +7,7 @@ A javascript library providing server defined loading of assets for a single pag
npm --save install es5-ff-spa-loader npm --save install es5-ff-spa-loader
Then use the es5-ff-spa-loader.js in header as script resource or inline in body. Then use the dist/es5-ff-spa-loader.min.js script inline in the index.
## Features ## Features
@ -104,7 +104,7 @@ A javascript library providing server defined loading of assets for a single pag
* localStorage * localStorage
* none * none
More custom types are possible like; (todo: needs testing) More custom schemas are possible like; (todo: needs testing)
FFSpaLoader.options.cache.meta = null; // use auto -> TODO: currently other cached need meta needs fixing. FFSpaLoader.options.cache.meta = null; // use auto -> TODO: currently other cached need meta needs fixing.
FFSpaLoader.options.cache.js = false; FFSpaLoader.options.cache.js = false;
@ -148,6 +148,9 @@ Add unit tests for any new or changed functionality. Lint and test your code.
## Release History ## Release History
### 0.0.3
* Fix script path in example
### 0.0.2 ### 0.0.2
* Limited example size * Limited example size

View file

@ -3,7 +3,6 @@
var express = require('express'); var express = require('express');
var path = require('path'); var path = require('path');
var fs = require('fs'); var fs = require('fs');
var minify = require('minify');
var fetch = require('fetch'); var fetch = require('fetch');
var cors = require('cors'); var cors = require('cors');
var morgan = require('morgan'); var morgan = require('morgan');
@ -89,10 +88,8 @@ function renderTemplatePath(viewPath) {
} }
function renderIndex() { function renderIndex() {
var inline = ''; var inlineData = fs.readFileSync(__dirname+'/../dist/es5-ff-spa-loader.min.js');
minify(__dirname+'/../es5-ff-spa-loader.js', {}, function(err, data) { var inline = '\n\t\t<script>'+inlineData+'</script>';
inline = '\n\t\t<script>'+data+'</script>';
});
var inlineNot = '\n\t\t<script src=\"/static/es5-ff-spa-loader.js\"></script>'; var inlineNot = '\n\t\t<script src=\"/static/es5-ff-spa-loader.js\"></script>';
return function (req, res) { return function (req, res) {
res.render('index', { res.render('index', {
@ -126,7 +123,7 @@ server.use('/static/module/angular', express.static(path.join(__dirname,'n
server.use('/static/module/angular-route', express.static(path.join(__dirname,'node_modules/angular-route'))); server.use('/static/module/angular-route', express.static(path.join(__dirname,'node_modules/angular-route')));
server.get('/static/es5-ff-spa-loader.js', function (req,res) { server.get('/static/es5-ff-spa-loader.js', function (req,res) {
res.write(fs.readFileSync(__dirname+'/../es5-ff-spa-loader.js', 'utf8')); res.write(fs.readFileSync(__dirname+'/../dist/es5-ff-spa-loader.js', 'utf8'));
res.end(); res.end();
}); });
server.get('/static/spa-client-resources', function (req,res) { server.get('/static/spa-client-resources', function (req,res) {

View file

@ -15,7 +15,6 @@
"express": "4.11.x", "express": "4.11.x",
"fetch": "0.3.x", "fetch": "0.3.x",
"jquery": "^2.1.4", "jquery": "^2.1.4",
"minify": "^2.0.2",
"morgan": "^1.6.1" "morgan": "^1.6.1"
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "es5-ff-spa-loader", "name": "es5-ff-spa-loader",
"version": "0.0.2", "version": "0.0.3",
"description": "Javascript Single Page Application Loader", "description": "Javascript Single Page Application Loader",
"main": "es5-ff-spa-loader.js", "main": "es5-ff-spa-loader.js",
"scripts": { "scripts": {