-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
151 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/nbproject/ | ||
/node_modules/ | ||
/build/* | ||
!/build/jquery-3.1.1.min.js | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
'use strict'; | ||
import gulp from 'gulp'; | ||
import del from 'del'; | ||
import source from 'vinyl-source-stream'; | ||
import browserify from 'browserify'; | ||
import babelify from 'babelify'; | ||
import ngAnnotate from 'browserify-ngannotate'; | ||
import templateCache from 'gulp-angular-templatecache'; | ||
import rename from 'gulp-rename'; | ||
import notify from 'gulp-notify'; | ||
import ejs from 'gulp-ejs'; | ||
import inject from 'gulp-inject'; | ||
import concat from 'gulp-concat'; | ||
import minifyCSS from 'gulp-minify-css'; | ||
|
||
// Where our files are located | ||
var jsFiles = "client/app/**/*.js"; | ||
var viewFiles = "client/app/**/*.html"; | ||
|
||
var interceptErrors = (error) => { | ||
var args = Array.prototype.slice.call(arguments); | ||
|
||
// Send error to notification center with gulp-notify | ||
notify.onError({ | ||
title: 'Compile Error', | ||
message: '<%= error.message %>' | ||
}).apply(this, args); | ||
|
||
// Keep gulp from hanging on this task | ||
this.emit('end'); | ||
}; | ||
|
||
gulp.task('default', ['build'], () => { | ||
console.log("Completed build."); | ||
}); | ||
|
||
gulp.task('build', ['browserify', 'css'], () => { | ||
gulp.start('html'); | ||
//gulp.start() will have to be replaced by gulp.series() when gulp 4.0 is released. | ||
}); | ||
|
||
gulp.task('browserify', ['views'], () => { | ||
return browserify(['./client/app/app.js']) | ||
.transform(babelify, {presets: ["es2015"]}) | ||
.transform(ngAnnotate) | ||
.bundle() | ||
.on('error', interceptErrors) | ||
.pipe(source('main.js')) | ||
.pipe(gulp.dest('./build/')); | ||
}); | ||
|
||
gulp.task('css', () => { | ||
gulp.src('./client/app/*.css') | ||
.pipe(minifyCSS()) | ||
.pipe(concat('style.css')) | ||
.on('error', interceptErrors) | ||
.pipe(gulp.dest('./build')); | ||
}); | ||
|
||
gulp.task('html', () => { | ||
const sources = gulp.src(['./build/*.js', './build/*.css'], {read: false}); | ||
|
||
return gulp.src("./client/index.html") | ||
.pipe(inject(sources, {relative: true, ignorePath: '../build/'})) | ||
.on('error', interceptErrors) | ||
.pipe(gulp.dest('./build/')); | ||
}); | ||
|
||
gulp.task('views', () => { | ||
return gulp.src(viewFiles) | ||
.pipe(templateCache({ | ||
standalone: true | ||
})) | ||
.on('error', interceptErrors) | ||
.pipe(rename("app.templates.js")) | ||
.pipe(gulp.dest('./client/app/config/')); | ||
}); | ||
|
||
gulp.task('clean', () => { | ||
del(['./build/**', '!./build']).then(paths => { | ||
console.log('Deleted files and folders:\n', paths.join('\n')); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,101 +1,66 @@ | ||
{ | ||
"name": "drawing-application", | ||
"version": "0.0.1", | ||
"description": "Webapp using Angular 1.5.x + ES6 + Webpack", | ||
"main": "index.js", | ||
"dependencies": { | ||
"angular": "^1.5.8", | ||
"angular-animate": "^1.5.8", | ||
"angular-aria": "^1.5.8", | ||
"angular-chart.js": "^1.0.3", | ||
"angular-loading-bar": "^0.9.0", | ||
"angular-material": "^1.1.1", | ||
"angular-material-icons": "^0.7.1", | ||
"angular-messages": "^1.5.8", | ||
"angular-sanitize": "^1.5.8", | ||
"angular-ui-router": "^1.0.0-beta.1", | ||
"angularfire": "^2.0.2", | ||
"body-parser": "^1.15.2", | ||
"cookie-parser": "^1.4.3", | ||
"cors": "^2.8.1", | ||
"express": "^4.14.0", | ||
"express-jwt": "^5.1.0", | ||
"jquery": "^3.1.1", | ||
"jsonwebtoken": "^7.1.9", | ||
"mongoose": "^4.6.3", | ||
"morgan": "^1.7.0", | ||
"normalize.css": "^3.0.3", | ||
"passport": "^0.3.2", | ||
"passport-local": "^1.0.0", | ||
"request": "^2.75.0", | ||
"serve-favicon": "^2.3.0" | ||
"name": "webapps3", | ||
"version": "1.0.0", | ||
"description": "Project WebApps 3", | ||
"main": "app.js", | ||
"scripts": { | ||
"dev": "nodemon --exec babel-node app.js", | ||
"prestart": "babel ./app.js --out-dir ./build", | ||
"start": "node ./build/app.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/gevalo1/WebApps3.git" | ||
}, | ||
"author": "Thomas Buys", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/gevalo1/WebApps3/issues" | ||
}, | ||
"homepage": "https://github.com/gevalo1/WebApps3#readme", | ||
"devDependencies": { | ||
"angular-mocks": "^1.5.8", | ||
"babel-core": "^6.17.0", | ||
"babel-jest": "^16.0.0", | ||
"babel-loader": "^6.2.5", | ||
"babel-cli": "^6.18.0", | ||
"babel-core": "^6.18.2", | ||
"babel-loader": "^6.2.7", | ||
"babel-plugin-transform-runtime": "^6.15.0", | ||
"babel-polyfill": "^6.16.0", | ||
"babel-preset-es2015": "^6.16.0", | ||
"babel-preset-stage-0": "^6.15.0", | ||
"babel-register": "^6.13.3", | ||
"babel-runtime": "^6.11.6", | ||
"browser-sync": "^2.17.3", | ||
"connect-history-api-fallback": "^1.3.0", | ||
"css-loader": "^0.25.0", | ||
"babel-preset-es2015": "^6.18.0", | ||
"babel-preset-stage-0": "^6.16.0", | ||
"babelify": "^7.3.0", | ||
"browser-sync": "^2.17.5", | ||
"browserify": "^13.1.1", | ||
"browserify-ngannotate": "^2.0.0", | ||
"del": "^2.2.2", | ||
"eslint": "^3.7.1", | ||
"fs-walk": "0.0.1", | ||
"gulp": "^3.9.1", | ||
"eslint": "^3.9.0", | ||
"eslint-config-standard": "^6.2.1", | ||
"eslint-plugin-promise": "^3.3.0", | ||
"eslint-plugin-standard": "^2.0.1", | ||
"gulp-angular-templatecache": "^2.0.0", | ||
"gulp-concat": "^2.6.0", | ||
"gulp-ejs": "^2.2.1", | ||
"gulp-html-replace": "^1.6.1", | ||
"gulp-inject": "^4.1.0", | ||
"gulp-minify-css": "^1.2.4", | ||
"gulp-nodemon": "^2.2.1", | ||
"gulp-notify": "^2.2.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-template": "^3.0.0", | ||
"gulp-util": "^3.0.7", | ||
"html-webpack-plugin": "^1.7.0", | ||
"jest": "^16.0.2", | ||
"lodash": "^4.16.4", | ||
"ng-annotate-loader": "0.2.0", | ||
"node-libs-browser": "^0.5.0", | ||
"node-sass": "^3.10.1", | ||
"raw-loader": "^0.5.1", | ||
"run-sequence": "^1.2.2", | ||
"sass-loader": "^4.0.2", | ||
"style-loader": "^0.13.1", | ||
"supports-color": "^3.1.2", | ||
"webpack": "^1.13.2", | ||
"webpack-dev-middleware": "^1.8.4", | ||
"webpack-hot-middleware": "^2.13.0", | ||
"yargs": "^3.9.0" | ||
"gulp-uglify": "^2.0.0", | ||
"vinyl-source-stream": "^1.1.0" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"test:watch": "jest --watch" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"webpack", | ||
"es6" | ||
], | ||
"author": "Thomas Buys", | ||
"jest": { | ||
"testPathDirs": [ | ||
"client" | ||
], | ||
"setupTestFrameworkScriptFile": "./jest.init.js", | ||
"verbose": "true", | ||
"moduleFileExtensions": [ | ||
"js" | ||
], | ||
"moduleDirectories": [ | ||
"node_modules" | ||
], | ||
"moduleNameMapper": { | ||
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js", | ||
"^.+\\.(css|scss)$": "<rootDir>/__mocks__/styleMock.js", | ||
"^.+\\.(html)$": "<rootDir>/__mocks__/htmlMock.js" | ||
} | ||
"dependencies": { | ||
"angular": "^1.5.8", | ||
"angular-ui-router": "^0.3.1", | ||
"babel-cli": "^6.18.0", | ||
"babel-register": "6.18.0", | ||
"babel-runtime": "^6.18.0", | ||
"body-parser": "1.15.2", | ||
"cookie-parser": "1.4.3", | ||
"ejs": "2.5.2", | ||
"express": "4.14.0", | ||
"gulp": "^3.9.1", | ||
"mongoose": "^4.6.6", | ||
"morgan": "1.7.0", | ||
"serve-favicon": "2.3.0", | ||
"socket.io": "^1.5.1" | ||
} | ||
} |