Skip to content

Commit

Permalink
Image and JS pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhawk1ns committed Oct 28, 2017
1 parent feb6d84 commit ee0378e
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 83 deletions.
21 changes: 21 additions & 0 deletions assets/admin/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const $ = jquery

class App
{
construct()
{
this.initialize(),
this.actions()
}
initialize()
{

}
actions()
{

}

}

new App();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 34 additions & 17 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,57 @@
'use strict';


import babel from 'gulp-babel';
import gulp from 'gulp';
import uglify from 'gulp-uglify';
import browserSync from 'browser-sync';
//import browsersync from 'browser-sync';
import sourcemaps from 'gulp-sourcemaps';
import rename from 'gulp-rename';
import imagemin from 'gulp-imagemin';
import merge from 'gulp-merge';
import concat from 'gulp-concat';
import autoprefixer from 'gulp-autoprefixer';
//import autoprefixer from 'gulp-autoprefixer';

const config = require("./package.json").config;

gulp.task('frontend', () => {
return gulp.src('js/*.js')
gulp.task('frontendJS', () => {
return gulp.src(config.assets.frontendScripts)
.pipe(sourcemaps.init({'loadMaps': true}))
.pipe(concat(config.public.frontendScripts))
.pipe(gulp.dest(config.public.dest))
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest(config.public.destJS))
.pipe(rename(config.public.frontendScriptsMin))
.pipe(uglify())
.pipe(sourcemaps.write('maps'))
.pipe(gulp.dest('public')), {base: './assets/'})
.pipe(gulp.dest(config.public.destJS))
});

gulp.task('adminJS', () => {
return gulp.src(config.assets.adminScripts)
.pipe(sourcemaps.init({'loadMaps': true}))
.pipe(concat(config.public.adminScripts))
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest(config.public.destJS))
.pipe(rename(config.public.adminScriptsMin))
.pipe(uglify())
.pipe(sourcemaps.write('maps'))
.pipe(gulp.dest(config.public.destJS))
});

gulp.task('admin', () => {
return gulp.src('js/*.js')
.pipe(sourcemaps.init({'loadMaps': true}))
.pipe(concat(config.public.adminScripts))
.pipe(gulp.dest(config.public.dest))
.pipe(rename(config.public.adminScriptsMin))
.pipe(uglify())
.pipe(sourcemaps.write('maps'))
.pipe(gulp.dest('public')), {base: './assets/'})
gulp.task( 'images', function() {
gulp.src( config.assets.images )
.pipe( imagemin( {
progressive: true,
optimizationLevel: 3,
interlaced: true,
svgoPlugins: [{removeViewBox: false}]
} ) )
.pipe(gulp.dest(config.public.destIMG))
});

gulp.task('build', ['frontend', 'admin']);
gulp.task('build', ['images', 'frontendJS', 'adminJS']);


20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"browsersync": "^0.0.1-security",
"eslint": "^4.9.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.0.0",
"gulp-babel": "^7.0.0",
"gulp-concat": "^2.6.1",
"gulp-imagemin": "^3.4.0",
Expand All @@ -27,17 +26,22 @@
},
"config": {
"assets": {
"frontImages": "./assets/frontend/images/*",
"frontScripts": "./assets/frontend/js/*",
"frontStyles": "./assets/frontend/js/*",
"adminScripts": "./assets/admin/js/*",
"adminStyles": "./assets/admin/sass/*"
"images": "./assets/images/*",
"frontendScripts": "./assets/frontend/js/*.js",
"frontendStyles": "./assets/frontend/sass/**/*.sass",
"adminScripts": "./assets/admin/js/*.js",
"adminStyles": "./assets/admin/sass/**/*.sass"
},
"public": {
"dest": "public",
"frontScripts": "frontend.js",
"frontStyles": "frontend.css",
"destJS": "./public/js",
"destIMG": "./public/images",
"frontendScripts": "frontend.js",
"frontendScriptsMin": "frontend.min.js",
"frontendStyles": "frontend.css",
"frontendStylesMin": "frontend.min.css",
"adminScripts": "admin.js",
"adminScriptsMin": "admin.min.js",
"adminStyles": "admin.css"
}
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions public/js/admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use strict";

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var $ = jquery;

var App = function () {
function App() {
_classCallCheck(this, App);
}

_createClass(App, [{
key: "construct",
value: function construct() {
this.initialize(), this.actions();
}
}, {
key: "initialize",
value: function initialize() {}
}, {
key: "actions",
value: function actions() {}
}]);

return App;
}();

new App();
2 changes: 2 additions & 0 deletions public/js/admin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions public/js/frontend.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use strict";

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var $ = jquery;

var App = function () {
function App() {
_classCallCheck(this, App);
}

_createClass(App, [{
key: "construct",
value: function construct() {
this.initialize(), this.actions();
}
}, {
key: "initialize",
value: function initialize() {}
}, {
key: "actions",
value: function actions() {}
}]);

return App;
}();

new App();
2 changes: 2 additions & 0 deletions public/js/frontend.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/js/maps/admin.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/js/maps/frontend.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 2 additions & 58 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,6 @@ atob@~1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/atob/-/atob-1.1.3.tgz#95f13629b12c3a51a5d215abdce2aa9f32f80773"

autoprefixer@^7.0.0:
version "7.1.6"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-7.1.6.tgz#fb933039f74af74a83e71225ce78d9fd58ba84d7"
dependencies:
browserslist "^2.5.1"
caniuse-lite "^1.0.30000748"
normalize-range "^0.1.2"
num2fraction "^1.2.2"
postcss "^6.0.13"
postcss-value-parser "^3.2.3"

babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
Expand Down Expand Up @@ -630,13 +619,6 @@ braces@^1.8.2:
preserve "^0.2.0"
repeat-element "^1.1.2"

browserslist@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.5.1.tgz#68e4bc536bbcc6086d62843a2ffccea8396821c6"
dependencies:
caniuse-lite "^1.0.30000744"
electron-to-chromium "^1.3.24"

browsersync@^0.0.1-security:
version "0.0.1-security"
resolved "https://registry.yarnpkg.com/browsersync/-/browsersync-0.0.1-security.tgz#e885fe4354d2ec5a565c38c4c2bf0a012ad64860"
Expand Down Expand Up @@ -679,10 +661,6 @@ camelcase@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"

caniuse-lite@^1.0.30000744, caniuse-lite@^1.0.30000748:
version "1.0.30000749"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000749.tgz#2ff382865aead8cca35dacfbab04f58effa4c01c"

capture-stack-trace@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz#4a6fa07399c26bba47f0b2496b4d0fb408c5550d"
Expand Down Expand Up @@ -1077,10 +1055,6 @@ each-async@^1.0.0, each-async@^1.1.1:
onetime "^1.0.0"
set-immediate-shim "^1.0.0"

electron-to-chromium@^1.3.24:
version "1.3.27"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz#78ecb8a399066187bb374eede35d9c70565a803d"

end-of-stream@^1.0.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206"
Expand Down Expand Up @@ -1691,16 +1665,6 @@ graceful-fs@~1.2.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"

gulp-autoprefixer@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/gulp-autoprefixer/-/gulp-autoprefixer-4.0.0.tgz#e00a8c571b85d06516ac26341be90dfd9fc1eab0"
dependencies:
autoprefixer "^7.0.0"
gulp-util "^3.0.0"
postcss "^6.0.1"
through2 "^2.0.0"
vinyl-sourcemaps-apply "^0.2.0"

gulp-babel@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-7.0.0.tgz#7b93c975159f7a0553e4263b4a55100ccc239b28"
Expand Down Expand Up @@ -2655,20 +2619,12 @@ normalize-path@^2.0.1, normalize-path@^2.1.1:
dependencies:
remove-trailing-separator "^1.0.1"

normalize-range@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"

npm-run-path@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f"
dependencies:
path-key "^2.0.0"

num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"

number-is-nan@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
Expand Down Expand Up @@ -2894,18 +2850,6 @@ popper.js@^1.12.6:
version "1.12.6"
resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.12.6.tgz#91e12a97b07815258b76915d64044e8ac053d426"

postcss-value-parser@^3.2.3:
version "3.3.0"
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15"

postcss@^6.0.1, postcss@^6.0.13:
version "6.0.13"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.13.tgz#b9ecab4ee00c89db3ec931145bd9590bbf3f125f"
dependencies:
chalk "^2.1.0"
source-map "^0.6.1"
supports-color "^4.4.0"

prelude-ls@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
Expand Down Expand Up @@ -3237,7 +3181,7 @@ source-map-url@~0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.3.0.tgz#7ecaf13b57bcd09da8a40c5d269db33799d4aaf9"

[email protected], source-map@^0.6.1, source-map@~0.6.1:
[email protected], source-map@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"

Expand Down Expand Up @@ -3394,7 +3338,7 @@ supports-color@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"

supports-color@^4.0.0, supports-color@^4.4.0:
supports-color@^4.0.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b"
dependencies:
Expand Down

0 comments on commit ee0378e

Please sign in to comment.