Skip to content

Commit

Permalink
Use rollup for bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Jan 24, 2017
1 parent 8c0c0ee commit 81f3a33
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
35 changes: 18 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
var commonjs = require('rollup-plugin-commonjs');
var nodeResolve = require('rollup-plugin-node-resolve');

var projs = [
'tmerc',
'utm',
Expand Down Expand Up @@ -51,21 +54,19 @@ module.exports = function(grunt) {
},
all: ['./lib/*.js', './lib/*/*.js']
},
browserify: {
all: {
files: {
'dist/proj4-src.js': ['lib/index.js'],
},
options: {
browserifyOptions: {
standalone: 'proj4'
},
alias: [
'./projs:./includedProjections',
'./lib/version-browser:./lib/version'
]
}
}
rollup: {
options: {
format: "umd",
moduleName: "proj4",
plugins: [
commonjs(),
nodeResolve()
]
},
files: {
dest: './dist/proj4-src.js',
src: './lib/index.js',
},
},
uglify: {
options: {
Expand All @@ -80,13 +81,13 @@ module.exports = function(grunt) {
}
}
});
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.registerTask('custom',function(){
grunt.task.run('browserify', 'uglify');
grunt.task.run('rollup', 'uglify');
var projections = this.args;
if(projections[0]==='default'){
grunt.file.write('./projs.js','module.exports = function(){}');
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
"chai": "~1.8.1",
"mocha": "~1.17.1",
"grunt-mocha-phantomjs": "~0.4.0",
"browserify": "~12.0.1",
"grunt-browserify": "~4.0.1",
"rollup": "^0.41.4",
"rollup-plugin-commonjs": "^7.0.0",
"rollup-plugin-node-resolve": "^2.0.0",
"grunt-rollup": "^1.0.1",
"grunt-contrib-uglify": "~0.11.1",
"curl": "git://github.com/cujojs/curl.git",
"istanbul": "~0.2.4",
Expand Down

0 comments on commit 81f3a33

Please sign in to comment.