Browse Source

Moving Rollup config out of Gruntfile.

v1-dev
Ændrew Rininsland 8 years ago
parent
commit
ed7396e995
No known key found for this signature in database
GPG Key ID: ADBCD4C867F9B2DA
  1. 13
      .babelrc
  2. 27
      Gruntfile.coffee
  3. 9943
      c3.js
  4. 10
      package.json
  5. 21
      rollup.config.js

13
.babelrc

@ -0,0 +1,13 @@
{
"presets": [
[
"es2015",
{
"modules": false
}
]
],
"plugins": [
"external-helpers"
]
}

27
Gruntfile.coffee

@ -1,24 +1,11 @@
module.exports = (grunt) ->
require('load-grunt-tasks') grunt, pattern: ['grunt-contrib-*', 'grunt-sass', 'grunt-karma', 'grunt-rollup']
require('load-grunt-tasks') grunt, pattern: ['grunt-contrib-*', 'grunt-sass', 'grunt-karma']
grunt.initConfig
rollup:
options:
external: ['d3']
format: "umd"
moduleName: "c3"
globals:
d3: 'd3'
files:
src: 'es6_modules/rollup.entry.js'
dest: 'c3.es6.js'
watch:
concat:
tasks: 'concat'
@ -136,7 +123,7 @@ module.exports = (grunt) ->
src: [
'src/head.js',
'src/axis/index.js',
'src/axis/c3.axis.js',
'src/axis/axis.js',
@ -175,7 +162,7 @@ module.exports = (grunt) ->
'src/chartinternal/transform.js',
'src/chartinternal/flow.js',
'src/chartinternal/ua.js',
'src/chart/index.js',
'src/chart/api.focus.js',
'src/chart/api.show.js',
@ -195,11 +182,11 @@ module.exports = (grunt) ->
'src/chart/api.legend.js',
'src/chart/api.chart.js',
'src/chart/api.tooltip.js',
'src/tail.js',
'src/polyfill.js'
]
dest: 'c3.js'
@ -236,4 +223,4 @@ module.exports = (grunt) ->
grunt.registerTask 'build', ['concat:dist', 'sass']
grunt.registerTask 'minify', ['cssmin', 'uglify']
grunt.registerTask 'default', ['lint', 'build', 'test', 'minify']
grunt.registerTask 'build_rollup', ['concat:axis', 'concat:chart', 'concat:chartinternal','rollup']
grunt.registerTask 'build_modules', ['concat:axis', 'concat:chart', 'concat:chartinternal']

9943
c3.js

File diff suppressed because one or more lines are too long

10
package.json

@ -6,7 +6,8 @@
"scripts": {
"lint": "grunt lint",
"test": "karma start karma.conf.js",
"codecov": "cat coverage/*/lcov.info | codecov"
"codecov": "cat coverage/*/lcov.info | codecov",
"build": "rollup -c"
},
"repository": {
"type": "git",
@ -25,6 +26,8 @@
"d3": "^3.5.17"
},
"devDependencies": {
"babel-plugin-external-helpers": "^6.8.0",
"babel-preset-es2015": "^6.14.0",
"codecov.io": "^0.1.6",
"grunt": "^1.0.1",
"grunt-contrib-concat": "^1.0.1",
@ -33,7 +36,6 @@
"grunt-contrib-uglify": "^1.0.1",
"grunt-contrib-watch": "^1.0.0",
"grunt-karma": "^2.0.0",
"grunt-rollup": "^0.7.1",
"grunt-sass": "^1.2.0",
"jasmine-core": "^2.4.1",
"jshint-stylish": "^2.2.0",
@ -43,6 +45,8 @@
"karma-phantomjs-launcher": "^1.0.1",
"karma-spec-reporter": "0.0.26",
"load-grunt-tasks": "^3.5.0",
"phantomjs-prebuilt": "^2.1.7"
"phantomjs-prebuilt": "^2.1.7",
"rollup": "^0.35.10",
"rollup-plugin-babel": "^2.6.1"
}
}

21
rollup.config.js

@ -0,0 +1,21 @@
/**
* Rollup Config
*/
import babel from 'rollup-plugin-babel';
export default {
entry: 'es6_modules/rollup.entry.js',
format: 'umd',
moduleName: 'c3',
external: ['d3'],
globals: {
d3: 'd3',
},
plugins: [
babel({
exclude: 'node_modules/**'
})
],
dest: 'c3.js'
};
Loading…
Cancel
Save