From 713ca22473306f55da3d436878f9cd825f8dd3ff Mon Sep 17 00:00:00 2001 From: Riccardo-Zanutta Date: Fri, 24 Jun 2016 22:32:08 +0200 Subject: [PATCH] Babelize build/ js files only --- config.json | 2 + gulpfile.babel.js | 17 +- package.json | 1 + src/css/application.css | 668 +++++++++++++++++++++++++++++++++++++++- src/js/application.js | 8 +- src/js/build/main.js | 4 +- 6 files changed, 691 insertions(+), 9 deletions(-) diff --git a/config.json b/config.json index dbec25b..56ccc89 100644 --- a/config.json +++ b/config.json @@ -8,6 +8,8 @@ "autoprefixer_options": { "browsers": ["last 3 versions", "ie > 9", "and_chr >= 2.3"] }, + "js_build_src": "./src/js/build/**/*.js", + "js_vendor_src": "./src/js/vendor/**/*.js", "js_src": ["./src/js/vendor/**/*.js", "./src/js/build/**/*.js"], "js_file_name": "application.js", "js_dest": "./src/js" diff --git a/gulpfile.babel.js b/gulpfile.babel.js index dab4e60..b37eecc 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -14,6 +14,7 @@ import gulpLoadPlugins from 'gulp-load-plugins'; import browserSync from 'browser-sync'; import del from 'del'; import runSequence from 'run-sequence'; +import merge from 'merge2'; import { argv } from 'yargs'; const $ = gulpLoadPlugins(); @@ -37,16 +38,20 @@ gulp.task('styles', () => { .pipe(gulp.dest(config.sass_dest)) }); -// Concat, sourcemaps and minify js files +// Concat, babelify, sourcemaps and minify js files gulp.task('scripts', () => { - gulp.src(config.js_src) + return merge( + gulp.src(config.js_vendor_src) + .pipe($.size({title: 'Vendor scripts'})), + gulp.src(config.js_build_src) + .pipe($.babel()) + ) .pipe($.if(argv.pretty, $.sourcemaps.init())) - .pipe($.babel()) .pipe($.concat(config.js_file_name)) .pipe($.if(!argv.pretty, $.uglify({preserveComments: 'some'}))) - .pipe($.if(argv.pretty, $.sourcemaps.write('.'))) + .pipe($.if(argv.pretty, $.sourcemaps.write('./'))) .pipe($.size({title: 'Scripts'})) - .pipe(gulp.dest(config.js_dest)) + .pipe(gulp.dest(config.js_dest)); }); // Clean the dist/ folder @@ -56,7 +61,7 @@ gulp.task('clean', () => { ]) }); -// Copy the content from the src/ folder to the dist/ one +// Copy the content from src/ to dist/ gulp.task('copy', ['clean'], () => { return gulp.src(config.src_folder) .pipe($.size({title: 'Copying ./src content in ./dist'})) diff --git a/package.json b/package.json index 4ac8e52..3b458c0 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "gulp-task-listing": "^1.0.1", "gulp-uglify": "^1.5.3", "gulp-util": "^3.0.7", + "merge2": "^1.0.2", "run-sequence": "^1.1.5", "yargs": "^4.3.2" } diff --git a/src/css/application.css b/src/css/application.css index 73e8a36..69e2bda 100644 --- a/src/css/application.css +++ b/src/css/application.css @@ -1 +1,667 @@ -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit;font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,select,textarea{font:inherit}optgroup{font-weight:700}button,input,select{overflow:visible}button,input,select,textarea{margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{cursor:pointer}[disabled]{cursor:default}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button:-moz-focusring,input:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}*,:after,:before{box-sizing:border-box}body,html{width:100%;height:100%;margin:0;padding:0}html{position:relative}body{background:#fff;color:#333;font-size:1em;font-family:Helvetica,Roboto,Arial,sans-serif;line-height:1.5;-webkit-tap-highlight-color:transparent;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::-moz-selection{background:#333;color:#fff;text-shadow:none}::selection{background:#333;color:#fff;text-shadow:none}::-webkit-selection{background:#333;color:#fff;text-shadow:none}img::-moz-selection{background:transparent}img::selection{background:transparent}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;color:inherit;line-height:1.25;margin:0 0 15px;padding:0}.h1,h1{font-size:3.6em}.h2,h2{font-size:3.1em}.h3,h3{font-size:2.6em}.h4,h4{font-size:2.35em}.h5,h5{font-size:1.85em}.h6,h6{font-size:1em}.small,small{font-size:.7em}a{color:#333;text-decoration:underline}a.link{text-decoration:none}a.link:hover{text-decoration:underline}p{margin:0 0 15px}hr{border-bottom:1px solid #333;border-left:none;border-right:none;border-top:none;margin:1.5em 0;clear:both}ol.list-inline,ul.list-inline{list-style:none;margin:0;padding:0}ol.list-inline li,ul.list-inline li{display:inline-block}em{font-style:italic}strong{font-weight:700}abbr[title]{border-bottom:1px dotted}abbr,acronym{cursor:help}code,tt{font-size:.75em}code,pre,tt{font-family:Consolas,Monaco,Bitstream Vera Sans Mono,Courier,monospace}pre{-moz-tab-size:2;tab-size:2;margin-bottom:12px;white-space:nowrap;border:1px solid #e1e1e1;border-radius:4px}pre>code{display:block;padding:1rem 1.5rem;white-space:pre}audio,embed,iframe,img,input,object,picture,video{max-width:100%;margin:0}img{display:inline-block;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}img[src*=".svg"]{width:100%\9}a:hover img{border:none;background:none}img[src*=".svg"],x::-ms-reveal{width:100%}a img{border:none}.button,button{cursor:pointer;text-decoration:none;background-color:transparent;padding:0;border:0;-ms-touch-action:manipulation;touch-action:manipulation;white-space:nowrap}.button{display:inline-block;text-align:center;vertical-align:middle}button{background-image:none}button:active,button:focus{outline:none;box-shadow:none;border:none}button.button-disabled,button[disabled]{cursor:not-allowed;opacity:.65}.button{background-color:#33c3f0;border-radius:3px;padding:5px 25px;color:#fff;margin-bottom:16px;transition:background-color .3s ease}.button:focus,.button:hover{background-color:#10aee0}.button-full{display:block;width:100%}fieldset{border:0;margin:0;padding:0}select,textarea{padding:6px 10px;box-shadow:none}input,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none}textarea{resize:none;height:auto;min-height:50px}.table{width:100%;margin-bottom:15px}.table td,.table th{border-bottom:.1rem solid #e1e1e1;padding:10px 20px;text-align:left}.table td:first-child,.table th:first-child{padding-left:0}.table td:last-child,.table th:last-child{padding-right:0}section{width:100%;display:block;position:relative}section:after,section:before{content:" ";display:table}section:after{clear:both}.content{width:1000px;margin:0 auto}.content:after,.content:before{content:" ";display:table}.content:after{clear:both}@media only screen and (min-width:75em){.content{width:1170px}}@media only screen and (max-width:64em){.content{width:95%}}.inner-container{width:100%}.inner-container:after,.inner-container:before{content:" ";display:table}.inner-container:after{clear:both}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-uppercase{text-transform:uppercase}.full-width{width:100%}.spacing{padding:15px 0}@media print{*,:after,:before,:first-letter,:first-line{background:transparent!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999}blockquote,img,pre{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}} \ No newline at end of file +/* normalize.css v4.0.0 | MIT License | github.com/necolas/normalize.css */ +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Prevent adjustments of font size after orientation changes in IE and iOS. + */ +html { + font-family: sans-serif; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ } + +/** + * Remove the margin in all browsers (opinionated). + */ +body { + margin: 0; } + +/* HTML5 display definitions + ========================================================================== */ +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + * 2. Add the correct display in IE. + */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +menu, +nav, +section, +summary { + /* 1 */ + display: block; } + +/** + * Add the correct display in IE 9-. + */ +audio, +canvas, +progress, +video { + display: inline-block; } + +/** + * Add the correct display in iOS 4-7. + */ +audio:not([controls]) { + display: none; + height: 0; } + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ +progress { + vertical-align: baseline; } + +/** + * Add the correct display in IE 10-. + * 1. Add the correct display in IE. + */ +template, +[hidden] { + display: none; } + +/* Links + ========================================================================== */ +/** + * Remove the gray background on active links in IE 10. + */ +a { + background-color: transparent; } + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ +a:active, +a:hover { + outline-width: 0; } + +/* Text-level semantics + ========================================================================== */ +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ +abbr[title] { + border-bottom: none; + /* 1 */ + text-decoration: underline; + /* 2 */ + text-decoration: underline dotted; + /* 2 */ } + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ +b, +strong { + font-weight: inherit; } + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ +b, +strong { + font-weight: bolder; } + +/** + * Add the correct font style in Android 4.3-. + */ +dfn { + font-style: italic; } + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ +h1 { + font-size: 2em; + margin: 0.67em 0; } + +/** + * Add the correct background and color in IE 9-. + */ +mark { + background-color: #ff0; + color: #000; } + +/** + * Add the correct font size in all browsers. + */ +small { + font-size: 80%; } + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sub { + bottom: -0.25em; } + +sup { + top: -0.5em; } + +/* Embedded content + ========================================================================== */ +/** + * Remove the border on images inside links in IE 10-. + */ +img { + border-style: none; } + +/** + * Hide the overflow in IE. + */ +svg:not(:root) { + overflow: hidden; } + +/* Grouping content + ========================================================================== */ +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + /* 1 */ + font-size: 1em; + /* 2 */ } + +/** + * Add the correct margin in IE 8. + */ +figure { + margin: 1em 40px; } + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ +hr { + box-sizing: content-box; + /* 1 */ + height: 0; + /* 1 */ + overflow: visible; + /* 2 */ } + +/* Forms + ========================================================================== */ +/** + * Change font properties to `inherit` in all browsers (opinionated). + */ +button, +input, +select, +textarea { + font: inherit; } + +/** + * Restore the font weight unset by the previous rule. + */ +optgroup { + font-weight: bold; } + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + * 2. Show the overflow in Edge, Firefox, and IE. + */ +button, +input, +select { + /* 2 */ + overflow: visible; } + +/** + * Remove the margin in Safari. + * 1. Remove the margin in Firefox and Safari. + */ +button, +input, +select, +textarea { + /* 1 */ + margin: 0; } + +/** + * Remove the inheritence of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritence of text transform in Firefox. + */ +button, +select { + /* 1 */ + text-transform: none; } + +/** + * Change the cursor in all browsers (opinionated). + */ +button, +[type="button"], +[type="reset"], +[type="submit"] { + cursor: pointer; } + +/** + * Restore the default cursor to disabled elements unset by the previous rule. + */ +[disabled] { + cursor: default; } + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS. + */ +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; + /* 2 */ } + +/** + * Remove the inner border and padding in Firefox. + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +/** + * Restore the focus styles unset by the previous rule. + */ +button:-moz-focusring, +input:-moz-focusring { + outline: 1px dotted ButtonText; } + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; } + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ +legend { + box-sizing: border-box; + /* 1 */ + color: inherit; + /* 2 */ + display: table; + /* 1 */ + max-width: 100%; + /* 1 */ + padding: 0; + /* 3 */ + white-space: normal; + /* 1 */ } + +/** + * Remove the default vertical scrollbar in IE. + */ +textarea { + overflow: auto; } + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ } + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; } + +/** + * Correct the odd appearance of search inputs in Chrome and Safari. + */ +[type="search"] { + -webkit-appearance: textfield; } + +/** + * Remove the inner padding and cancel buttons in Chrome on OS X and + * Safari on OS X. + */ +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +/* BASE */ +*, *:before, *:after { + box-sizing: border-box; } + +html, body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; } + +html { + position: relative; } + +body { + background: #ffffff; + color: #333333; + font-size: 1em; + font-family: "Helvetica", "Roboto", "Arial", sans-serif; + line-height: 1.5; + -webkit-tap-highlight-color: transparent; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + +::-moz-selection { + background: #333333; + color: #ffffff; + text-shadow: none; } + +::selection { + background: #333333; + color: #ffffff; + text-shadow: none; } + +::-webkit-selection { + background: #333333; + color: #ffffff; + text-shadow: none; } + +img::-moz-selection { + background: transparent; } + +img::selection { + background: transparent; } + +/* Basic Typography */ +h1, h2, h3, h4, h5, h6, +.h1, .h2, .h3, .h4, .h5, .h6 { + font-family: inherit; + color: inherit; + line-height: 1.25; + margin: 0 0 15px 0; + padding: 0; } + +h1, .h1 { + font-size: 3.6em; } + +h2, .h2 { + font-size: 3.1em; } + +h3, .h3 { + font-size: 2.6em; } + +h4, .h4 { + font-size: 2.35em; } + +h5, .h5 { + font-size: 1.85em; } + +h6, .h6 { + font-size: 1em; } + +small, .small { + font-size: 0.7em; } + +a { + color: #333333; + text-decoration: underline; } + a.link { + text-decoration: none; } + a.link:hover { + text-decoration: underline; } + +p { + margin: 0 0 15px 0; } + +hr { + border-bottom: 1px solid #333333; + border-left: none; + border-right: none; + border-top: none; + margin: 1.5em 0; + clear: both; } + +ul.list-inline, ol.list-inline { + list-style: none; + margin: 0; + padding: 0; } + ul.list-inline li, ol.list-inline li { + display: inline-block; } + +em { + font-style: italic; } + +strong { + font-weight: bold; } + +abbr[title] { + border-bottom: 1px dotted; } + +abbr, acronym { + cursor: help; } + +tt, code { + font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier", monospace; + font-size: 0.75em; } + +pre { + font-family: "Consolas", "Monaco", "Bitstream Vera Sans Mono", "Courier", monospace; + -moz-tab-size: 2; + tab-size: 2; + margin-bottom: 12px; + white-space: nowrap; + border: 1px solid #E1E1E1; + border-radius: 4px; } + pre > code { + display: block; + padding: 1rem 1.5rem; + white-space: pre; } + +/* Media elements */ +img, picture, video, audio, embed, object, input, iframe { + max-width: 100%; + margin: 0; } + +img { + display: inline-block; + vertical-align: middle; + border: 0; + -ms-interpolation-mode: bicubic; } + img[src*=".svg"] { + width: 100% \9; } + a:hover img { + border: none; + background: none; } + +x::-ms-reveal, img[src*=".svg"] { + width: 100%; } + +a img { + border: none; } + +/* Button Module */ +button, .button { + cursor: pointer; + text-decoration: none; + background-color: transparent; + padding: 0; + border: 0; + -ms-touch-action: manipulation; + touch-action: manipulation; + white-space: nowrap; } + +.button { + display: inline-block; + text-align: center; + vertical-align: middle; } + +button { + background-image: none; } + button:focus, button:active { + outline: none; + box-shadow: none; + border: none; } + button.button-disabled, button[disabled] { + cursor: not-allowed; + opacity: 0.65; } + +.button { + background-color: #33C3F0; + border-radius: 3px; + padding: 5px 25px; + color: white; + margin-bottom: 16px; + transition: background-color 0.3s ease; } + .button:hover, .button:focus { + background-color: #10aee0; } + +.button-full { + display: block; + width: 100%; } + +/* Header module */ +/* Form Module */ +fieldset { + border: 0; + margin: 0; + padding: 0; } + +textarea, select { + padding: 6px 10px; + box-shadow: none; } + +textarea, input { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } + +textarea { + resize: none; + height: auto; + min-height: 50px; } + +.table { + width: 100%; + margin-bottom: 15px; } + .table th, .table td { + border-bottom: .1rem solid #e1e1e1; + padding: 10px 20px; + text-align: left; } + .table th:first-child, .table td:first-child { + padding-left: 0; } + .table th:last-child, .table td:last-child { + padding-right: 0; } + +/* General layout */ +section { + width: 100%; + display: block; + position: relative; } + section:before, section:after { + content: " "; + display: table; } + section:after { + clear: both; } + +.content { + width: 1000px; + margin: 0 auto; } + .content:before, .content:after { + content: " "; + display: table; } + .content:after { + clear: both; } + @media only screen and (min-width: 75em) { + .content { + width: 1170px; } } + @media only screen and (max-width: 64em) { + .content { + width: 95%; } } + +.inner-container { + width: 100%; } + .inner-container:before, .inner-container:after { + content: " "; + display: table; } + .inner-container:after { + clear: both; } + +.text-center { + text-align: center; } + +.text-left { + text-align: left; } + +.text-right { + text-align: right; } + +.text-uppercase { + text-transform: uppercase; } + +.full-width { + width: 100%; } + +.spacing { + padding: 15px 0; } + +/* PRINT STYLES */ +@media print { + *, *:before, *:after, *:first-letter, *:first-line { + background: transparent !important; + color: #000 !important; + box-shadow: none !important; + text-shadow: none !important; } + a, a:visited { + text-decoration: underline; } + a[href]:after { + content: " (" attr(href) ")"; } + abbr[title]:after { + content: " (" attr(title) ")"; } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; } + pre, blockquote { + border: 1px solid #999; + page-break-inside: avoid; } + img { + max-width: 100% !important; + page-break-inside: avoid; } + p, h2, h3 { + orphans: 3; + widows: 3; } + h2, h3 { + page-break-after: avoid; } } + +/*# sourceMappingURL=application.css.map */ diff --git a/src/js/application.js b/src/js/application.js index 25c02f0..6e4ef10 100644 --- a/src/js/application.js +++ b/src/js/application.js @@ -1 +1,7 @@ -"use strict";console.log("Hello BRick!"); \ No newline at end of file + +'use strict'; + +var brick = 'BRick!'; + +console.log('Hello ' + brick); +//# sourceMappingURL=application.js.map diff --git a/src/js/build/main.js b/src/js/build/main.js index 206e312..7c62543 100644 --- a/src/js/build/main.js +++ b/src/js/build/main.js @@ -1 +1,3 @@ -console.log('Hello BRick!'); \ No newline at end of file +const brick = 'BRick!'; + +console.log(`Hello ${brick}`); \ No newline at end of file