Skip to content

Commit

Permalink
Add a Grunt task to build the browserify lib. Ref #16.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeyZ committed Aug 9, 2015
1 parent c1d450d commit 899bb39
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
module.exports = function (grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
client: {
src: ['./index.js'],
dest: 'browserify/jsonapi-serializer.js',
options: {
require: ['./index.js:jsonapi-serializer']
}
}
}
});

grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('default', ['browserify']);
};
2 changes: 1 addition & 1 deletion browserify/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<title>Browserify Test</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script>
<script type="text/javascript" src="bundle.js"></script>
<script type="text/javascript" src="jsonapi-serializer.js"></script>
<script>
var JSONAPISerializer = require('jsonapi-serializer');

Expand Down
2 changes: 1 addition & 1 deletion browserify/bundle.js → browserify/jsonapi-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13541,4 +13541,4 @@ module.exports = function (collectionName, records, opts) {
},{}],"jsonapi-serializer":[function(require,module,exports){
module.exports = require('./lib/serializer');

},{"./lib/serializer":2}]},{},[]);
},{"./lib/serializer":2}]},{},["jsonapi-serializer"]);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
},
"devDependencies": {
"chai": "^2.3.0",
"grunt": "^0.4.5",
"grunt-browserify": "^4.0.0",
"mocha": "^2.2.5"
}
}

0 comments on commit 899bb39

Please sign in to comment.