diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..2dd04f16 --- /dev/null +++ b/.babelrc @@ -0,0 +1,4 @@ +{ + sourceMap: true, + presets: [ "es2015-rollup" ] +} diff --git a/Gruntfile.js b/Gruntfile.js index 7b45c19d..897f49f4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -123,30 +123,30 @@ module.exports = function (grunt) { docs: 'docs/dist' }, - babel: { - options: { - sourceMap: true, - presets: ['es2015'] // the following is the es2015 preset minus the commonjs requirement - }, - core: { - files: coreFileMap('dist/js/demoduled/', 'js/src/') - }, - docs: { - files: docsFileMap() - }, - systemjs: { - options: { - plugins: ['transform-es2015-modules-systemjs'] - }, - files: coreFileMap('dist/js/systemjs/', 'js/src/') - }, - umd: { - options: { - plugins: ['transform-es2015-modules-umd'] - }, - files: coreFileMap('dist/js/umd/', 'js/src/') - } - }, + //babel: { + // options: { + // sourceMap: true, + // presets: ['es2015'] // the following is the es2015 preset minus the commonjs requirement + // }, + // core: { + // files: coreFileMap('dist/js/demoduled/', 'js/src/') + // }, + // docs: { + // files: docsFileMap() + // }, + // systemjs: { + // options: { + // plugins: ['transform-es2015-modules-systemjs'] + // }, + // files: coreFileMap('dist/js/systemjs/', 'js/src/') + // }, + // umd: { + // options: { + // plugins: ['transform-es2015-modules-umd'] + // }, + // files: coreFileMap('dist/js/umd/', 'js/src/') + // } + //}, eslint: { options: { @@ -187,20 +187,20 @@ module.exports = function (grunt) { } }, - concat: { - options: { - stripBanners: false, - sourceMap: true - }, - systemjs: { - src: coreFileArray('dist/js/systemjs/'), - dest: 'dist/js/system-all.js' - }, - commonjs: { - src: coreFileArray('dist/js/umd/'), - dest: 'dist/js/common-all.js' - } - }, + //concat: { + // options: { + // stripBanners: false, + // sourceMap: true + // }, + // systemjs: { + // src: coreFileArray('dist/js/systemjs/'), + // dest: 'dist/js/system-all.js' + // }, + // commonjs: { + // src: coreFileArray('dist/js/umd/'), + // dest: 'dist/js/common-all.js' + // } + //}, uglify: { options: { compress: { @@ -209,14 +209,30 @@ module.exports = function (grunt) { mangle: false, preserveComments: /^!|@preserve|@license|@cc_on/i }, - 'systemjs-all': { - src: 'dist/js/system-all.js', - dest: 'dist/js/system-all.min.js' - }, - 'commonjs-all': { - src: 'dist/js/common-all.js', - dest: 'dist/js/common-all.min.js' - }, + + dist: { + files: { + 'dist/js/bootstrap-material-design.es6.min.js': 'dist/js/bootstrap-material-design.es6.js', + 'dist/js/bootstrap-material-design.umd.min.js': 'dist/js/bootstrap-material-design.umd.js' + } + } + //'systemjs-all': { + // src: 'dist/js/system-all.js', + // dest: 'dist/js/system-all.min.js' + //}, + //'commonjs-all': { + // src: 'dist/js/common-all.js', + // dest: 'dist/js/common-all.min.js' + //}, + + //'systemjs-all': { + // src: 'dist/js/system-all.js', + // dest: 'dist/js/system-all.min.js' + //}, + //'commonjs-all': { + // src: 'dist/js/common-all.js', + // dest: 'dist/js/common-all.min.js' + //}, // docs: { // options: { // compress: false @@ -495,14 +511,13 @@ module.exports = function (grunt) { exec: { npmUpdate: { command: 'npm update' + }, + 'rollup-umd': { + command: 'rollup -c rollup.umd.config.js' + }, + 'rollup-es6': { + command: 'rollup -c rollup.es6.config.js' } - //, - //'jekyll-clean': { - // command: 'jekyll clean' - //}, - //'jekyll-build': { - // command: 'jekyll build' - //} }, buildcontrol: { @@ -594,15 +609,18 @@ module.exports = function (grunt) { grunt.registerTask('dist-js', [ 'clean:dist-js', 'eslint', - 'babel:umd', - 'babel:systemjs', - 'commonjs', - 'systemjs', - 'concat:commonjs', - 'concat:systemjs', + 'exec:rollup-umd', + 'exec:rollup-es6', + //'babel:umd', + //'babel:systemjs', + //'commonjs', + //'systemjs', + //'concat:commonjs', + //'concat:systemjs', 'stamp', - 'uglify:commonjs-all', - 'uglify:systemjs-all', + //'uglify:commonjs-all', + //'uglify:systemjs-all', + 'uglify:dist', 'copy:dist-to-docs' ]); diff --git a/js/src/checkbox.js b/js/src/checkbox.js index f8c357d3..84969414 100644 --- a/js/src/checkbox.js +++ b/js/src/checkbox.js @@ -2,7 +2,7 @@ import BaseSelection from './baseSelection' import Text from './text' import File from './file' import Radio from './radio' -import Textarea from './textare' +import Textarea from './textarea' import Select from './select' import Util from './util' diff --git a/js/src/file.js b/js/src/file.js index dc7338c1..6316e6e1 100644 --- a/js/src/file.js +++ b/js/src/file.js @@ -3,7 +3,7 @@ import Checkbox from './checkbox' import Radio from './radio' import Switch from './switch' import Text from './text' -import Textarea from './textare' +import Textarea from './textarea' import Select from './select' import Util from './util' diff --git a/js/src/select.js b/js/src/select.js index cdf3400d..e8bdd7d1 100644 --- a/js/src/select.js +++ b/js/src/select.js @@ -3,7 +3,7 @@ import File from './file' import Radio from './radio' import Switch from './switch' import Text from './text' -import Textarea from './textare' +import Textarea from './textarea' import Util from './util' const Select = (($) => { diff --git a/js/src/text.js b/js/src/text.js index 9639fd2d..8754b930 100644 --- a/js/src/text.js +++ b/js/src/text.js @@ -3,7 +3,7 @@ import Checkbox from './checkbox' import File from './file' import Radio from './radio' import Switch from './switch' -import Textarea from './textare' +import Textarea from './textarea' import Select from './select' import Util from './util' diff --git a/package.json b/package.json index df3f7db5..1ae6aae5 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ }, "style": "dist/css/bootstrap-material-design.css", "sass": "scss/bootstrap-material-design.scss", - "main": "dist/js/common.js", - "jsnext:main": "dist/rollup.es6.js", + "main": "dist/js/bootstrap-material-design.umd.js", + "jsnext:main": "dist/bootstrap-material-design.es6.js", "repository": { "type": "git", "url": "https://github.com/FezVrasta/bootstrap-material-design.git" @@ -35,18 +35,14 @@ "devDependencies": { "autoprefixer": "^6.0.3", "babel-eslint": "^4.1.6", - "babel-plugin-transform-es2015-modules-systemjs": "^6.0", - "babel-plugin-transform-es2015-modules-umd": "^6.0", "babel-polyfill": "^6.0", - "babel-preset-es2015": "^6.0", + "babel-preset-es2015-rollup": "^1.0.0", "btoa": "~1.1.2", "glob": "~6.0.1", "grunt": "~0.4.5", - "grunt-babel": "^6.0", "grunt-build-control": "~0.6.0", "grunt-contrib-clean": "~0.7.0", "grunt-contrib-compress": "~0.14.0", - "grunt-contrib-concat": "~0.5.1", "grunt-contrib-connect": "~0.11.2", "grunt-contrib-copy": "~0.8.1", "grunt-contrib-cssmin": "~0.14.0", @@ -64,7 +60,6 @@ "grunt-sass": "^1.0.0", "grunt-saucelabs": "~8.6.1", "grunt-scss-lint": "^0.3.8", - "grunt-sed": "~0.1.1", "grunt-stamp": "^0.1.0", "is-travis": "^1.0.0", "load-grunt-tasks": "~3.3.0", @@ -73,6 +68,7 @@ "npm-shrinkwrap": "^200.1.0", "rollup": "^0.22", "rollup-plugin-babel": "^2.3", + "rollup-plugin-multi-entry": "^1.0", "time-grunt": "^1.2.1" }, "engines": { diff --git a/rollup.config.js b/rollup.config.js index f0bddbdb..92152d97 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,6 +1,9 @@ import babel from 'rollup-plugin-babel'; +//var external = Object.keys( require( './package.json' ).dependencies ); + export default { entry: 'js/src/index.js', plugins: [babel()] + //external: external }; diff --git a/rollup.es6.config.js b/rollup.es6.config.js index da36ba85..a559a22c 100644 --- a/rollup.es6.config.js +++ b/rollup.es6.config.js @@ -1,6 +1,6 @@ import config from './rollup.config'; config.format = 'es6'; -config.dest = 'dist/rollup.es6.config.js'; +config.dest = 'dist/js/bootstrap-material-design.es6.js'; export default config; diff --git a/rollup.umd.config.js b/rollup.umd.config.js index dbc38281..b413b210 100644 --- a/rollup.umd.config.js +++ b/rollup.umd.config.js @@ -2,7 +2,7 @@ import config from './rollup.config'; config.format = 'umd'; -config.dest = 'dist/rollup.umd.config.js'; config.moduleName = 'bootstrapMaterialDesign'; +config.dest = 'dist/js/bootstrap-material-design.umd.js'; export default config;