Skip to content

Commit

Permalink
chore: setup browserify and babel
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Cejudo authored and javiercejudo committed Apr 1, 2016
1 parent e1fcd45 commit eec87e6
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
8 changes: 8 additions & 0 deletions index.es5.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*jshint node:true, esnext: true */

'use strict';

require('core-js/fn/map');
require('core-js/fn/array/from');

module.exports = require('./');
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
<script src="dist/modelico.js"></script>
</head>
<body>

</body>
</html>
14 changes: 14 additions & 0 deletions index.ie8.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*jshint node:true, esnext: true */

'use strict';

require('core-js/fn/object/create');
require('core-js/fn/object/define-property');
require('core-js/fn/object/keys');
require('core-js/fn/object/get-own-property-names');
require('core-js/fn/object/get-prototype-of');
require('core-js/fn/object/freeze');

require('core-js/fn/date/to-iso-string');

module.exports = require('./index.es5');
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
"description": "Serialisable model classes",
"main": "index.js",
"scripts": {
"test": "gulp test"
"test": "gulp test",
"prebuild": "mkdir -p dist",
"build": "npm run build-modern && npm run build-es5 && npm run build-ie8",
"build-modern": "browserify -r ./index.js:modelico -o dist/modelico.js",
"build-es5": "browserify -r ./index.es5.js:modelico -t babelify -o dist/modelico.es5.js",
"build-ie8": "browserify -r ./index.ie8.js:modelico -t babelify -o dist/modelico.ie8.js",
"version": "npm run build && git add -A dist"
},
"repository": {
"type": "git",
Expand All @@ -21,6 +27,10 @@
},
"homepage": "https://github.com/javiercejudo/modelico#readme",
"devDependencies": {
"babel-preset-es2015": "^6.6.0",
"babelify": "^7.2.0",
"browserify": "^13.0.0",
"core-js": "^2.2.1",
"gulp": "^3.9.0",
"gulp-coverage": "^0.3.38",
"gulp-coveralls": "^0.1.4",
Expand Down

0 comments on commit eec87e6

Please sign in to comment.