From 027c4278fd556df5945b3ef2869948f150b64708 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Mon, 26 May 2014 09:14:22 +0200 Subject: [PATCH] chore(viewer): remove brfs dependency This commit removes the build dependency on brfs by inlining the bpmn-js logo directly into the source code. Because of that users have an easier time integrating the library. --- Gruntfile.js | 3 +-- lib/Viewer.js | 9 +++++++-- package.json | 3 --- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1d827082..2c5a2ea9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -75,9 +75,8 @@ module.exports = function(grunt) { }, browserify: { options: { - transform: [ 'brfs' ], browserifyOptions: { - builtins: [ 'fs' ], + builtins: false, commondir: false }, bundleOptions: { diff --git a/lib/Viewer.js b/lib/Viewer.js index d0e00321..70576c47 100644 --- a/lib/Viewer.js +++ b/lib/Viewer.js @@ -1,6 +1,5 @@ var Diagram = require('diagram-js'), BpmnModel = require('bpmn-moddle'), - fs = require('fs'), $ = require('jquery'), _ = require('lodash'); @@ -67,7 +66,13 @@ function Viewer(options) { * * */ - var logoData = fs.readFileSync(__dirname + '/../resources/bpmnjs.png', 'base64'); + + /* jshint -W101 */ + + // inlined ../resources/bpmnjs.png + var logoData = 'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAMAAADypuvZAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRFiMte9PrwldFwfcZPqtqN0+zEyOe1XLgjvuKncsJAZ70y6fXh3vDT////UrQV////G2zN+AAAABB0Uk5T////////////////////AOAjXRkAAAHDSURBVHjavJZJkoUgDEBJmAX8979tM8u3E6x20VlYJfFFMoL4vBDxATxZcakIOJTWSmxvKWVIkJ8jHvlRv1F2LFrVISCZI+tCtQx+XfewgVTfyY3plPiQEAzI3zWy+kR6NBhFBYeBuscJLOUuA2WVLpCjVIaFzrNQZArxAZKUQm6gsj37L9Cb7dnIBUKxENaaMJQqMpDXvSL+ktxdGRm2IsKgJGGPg7atwUG5CcFUEuSv+CwQqizTrvDTNXdMU2bMiDWZd8d7QIySWVRsb2vBBioxOFt4OinPBapL+neAb5KL5IJ8szOza2/DYoipUCx+CjO0Bpsv0V6mktNZ+k8rlABlWG0FrOpKYVo8DT3dBeLEjUBAj7moDogVii7nSS9QzZnFcOVBp1g2PyBQ3Vr5aIapN91VJy33HTJLC1iX2FY6F8gRdaAeIEfVONgtFCzZTmoLEdOjBDfsIOA6128gw3eu1shAajdZNAORxuQDJN5A5PbEG6gNIu24QJD5iNyRMZIr6bsHbCtCU/OaOaSvgkUyDMdDa1BXGf5HJ1To+/Ym6mCKT02Y+/Sa126ZKyd3jxhzpc1r8zVL6YM1Qy/kR4ABAFJ6iQUnivhAAAAAAElFTkSuQmCC'; + + /* jshint +W101 */ var a = $('').css({ position: 'absolute', diff --git a/package.json b/package.json index 42b09f3b..c8d3ade8 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,6 @@ } ], "license": "http://bpmn.io/license", - "browser": { - "fs": false - }, "devDependencies": { "grunt": "~0.4.4", "grunt-contrib-watch": "~0.5.0",