Merge pull request #6 from CartoDB/browserify_fixes

browserify fixes
This commit is contained in:
Raul Ochoa 2014-12-17 14:47:42 +01:00
commit bbfe3b3084
11 changed files with 20 additions and 14 deletions

View File

@ -3,6 +3,7 @@
#
expresso = ./node_modules/.bin/mocha
UGLIFYJS=./node_modules/.bin/uglifyjs
BROWSERIFY = ./node_modules/.bin/browserify
lint:
@ -22,6 +23,10 @@ dist:
mkdir -p dist
dist/carto.uncompressed.js: dist $(shell $(BROWSERIFY) --list lib/carto/index.js)
$(BROWSERIFY) --debug lib/carto/index.js --standalone carto > $@
$(BROWSERIFY) lib/carto/index.js --exclude node_modules/underscore/underscore.js --standalone carto > $@
dist/carto.js: dist/carto.uncompressed.js $(shell $(BROWSERIFY) --list lib/carto/index.js)
$(UGLIFYJS) dist/carto.uncompressed.js > $@
.PHONY: test

View File

@ -1,6 +1,6 @@
var carto = exports,
tree = require('./tree'),
_ = require('underscore');
_ = global._ || require('underscore');
// Token matching is done with the `$` function, which either takes
// a terminal string or regexp, or a non-terminal function to call.

View File

@ -1,4 +1,4 @@
var _ = require('underscore');
var _ = global._ || require('underscore');
var carto = require('./index');
carto.Renderer = function Renderer(env, options) {

View File

@ -1,6 +1,6 @@
(function(carto) {
var tree = require('./tree');
var _ = require('underscore');
var _ = global._ || require('underscore');
function CartoCSS(style, options) {

View File

@ -1,5 +1,5 @@
(function(tree) {
var _ = require('underscore');
var _ = global._ || require('underscore');
tree.Call = function Call(name, args, index) {
this.name = name;
this.args = args;

View File

@ -1,6 +1,6 @@
(function(tree) {
var assert = require('assert'),
_ = require('underscore');
_ = global._ || require('underscore');
// A definition is the combination of a selector and rules, like
// #foo {

View File

@ -1,5 +1,5 @@
(function(tree) {
var _ = require('underscore');
var _ = global._ || require('underscore');
//
// A number with a unit
//

View File

@ -1,5 +1,5 @@
var tree = require('../tree');
var _ = require('underscore');
var _ = global._ || require('underscore');
tree.Filterset = function Filterset() {
this.filters = {};

View File

@ -4,7 +4,7 @@
// combinations.
(function(tree) {
var _ = require('underscore'),
var _ = global._ || require('underscore'),
ref = {};
ref.setData = function(data) {

View File

@ -1,5 +1,5 @@
(function(tree) {
var _ = require('underscore');
var _ = global._ || require('underscore');
// Given a style's name, attachment, definitions, and an environment object,
// return a stringified style for Mapnik

View File

@ -9,7 +9,7 @@
},
"author": {
"name": "CartoDB",
"url": "http://cartodb.com/",
"url": "http://cartodb.com/"
},
"keywords": [
"maps",
@ -19,9 +19,9 @@
"contributors": [
"Tom MacWright <macwright@gmail.com>",
"Konstantin Käfer",
"Alexis Sellier <self@cloudhead.net>"
"Alexis Sellier <self@cloudhead.net>",
"Raul Ochoa <rochoa@cartodb.com>",
"Javi Santana <jsantana@cartodb.com>",
"Javi Santana <jsantana@cartodb.com>"
],
"licenses": [
{
@ -47,7 +47,8 @@
"sax": "0.1.x",
"istanbul": "~0.2.14",
"coveralls": "~2.10.1",
"browserify": "~7.0.0"
"browserify": "~7.0.0",
"uglify-js": "1.3.3"
},
"scripts": {
"pretest": "npm install",