rollup is generating files, still failing on uglify

This commit is contained in:
Kevin Ross 2015-12-30 15:51:52 -06:00
parent ff95eb2495
commit 9139136e07
10 changed files with 96 additions and 75 deletions

4
.babelrc Normal file
View File

@ -0,0 +1,4 @@
{
sourceMap: true,
presets: [ "es2015-rollup" ]
}

View File

@ -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'
]);

View File

@ -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'

View File

@ -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'

View File

@ -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 = (($) => {

View File

@ -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'

View File

@ -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": {

View File

@ -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
};

View File

@ -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;

View File

@ -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;