This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
-
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.
Use "grunt dev" for a local dev server. It automagically minifes everything as it does. Create a Gruntfile with - uglify (to minify js) - cssmin (to minify css) - imagemin (" images) - copy (to move html + fonts) Moved all development assets to a new assets folder. All work should be done in there. The static folder now holds built files. Grunt newer is used to ensure that we only build the extra files we need to every time we build. The default task starts a production server, and the dev task starts a development server. Removed the app-local.js file - it's no longer needed.
- Loading branch information
1 parent
d362ce4
commit 564b495
Showing
72 changed files
with
5,552 additions
and
139 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 |
---|---|---|
|
@@ -55,5 +55,4 @@ typings/ | |
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
.env |
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,94 @@ | ||
module.exports = function (grunt) { | ||
// Project config | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
ngAnnotate: { | ||
build: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'Website/assets/js/', | ||
src: ['**/*.js', '!**/*.annotated.js'], | ||
dest: 'Website/assets/js/' | ||
//ext: '.annotated.js', | ||
//extDot: 'last' | ||
}] | ||
} | ||
}, | ||
uglify: { | ||
build: { | ||
src: [ | ||
'Website/assets/js/jquery.js', | ||
'Website/assets/js/bootstrap.min.js', | ||
'Website/assets/js/angular.min.js', | ||
'Website/assets/js/*.js' | ||
], | ||
dest: 'Website/static/js/app.min.js' | ||
} | ||
}, | ||
cssmin: { | ||
build: { | ||
src: 'Website/assets/css/*.css', | ||
dest: 'Website/static/css/app.min.css' | ||
} | ||
}, | ||
imagemin: { | ||
build: { | ||
files: [{ | ||
expand: true, | ||
cwd: "Website/assets/images/", | ||
src: "**/*.{jpg,png,gif}", | ||
dest: "Website/static/images/" | ||
}] | ||
} | ||
}, | ||
copy: { | ||
html: { | ||
expand: true, | ||
cwd: "Website/assets/", | ||
src: "*.html", | ||
dest: "Website/static/" | ||
}, | ||
fonts: { | ||
expand: true, | ||
cwd: "Website/assets/fonts/", | ||
src: "**/*", | ||
dest: "Website/static/fonts" | ||
} | ||
}, | ||
run: { | ||
prod: { | ||
cmd: 'node', | ||
args: [ | ||
'Website/app.js', | ||
'prod' | ||
] | ||
}, | ||
dev: { | ||
cmd: 'node', | ||
args: [ | ||
'Website/app.js', | ||
'dev' | ||
] | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-ng-annotate') // angular js doesn't like minification normally | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); // js minification | ||
grunt.loadNpmTasks('grunt-contrib-cssmin'); // css minification | ||
grunt.loadNpmTasks('grunt-contrib-imagemin'); // image minification | ||
grunt.loadNpmTasks('grunt-contrib-copy'); // copy over html | ||
|
||
grunt.loadNpmTasks('grunt-newer'); // only run on new files - takes like 5 mins to run from scratch | ||
grunt.loadNpmTasks('grunt-run'); // used to start the server | ||
|
||
// Default task - build assets, and start a production server | ||
grunt.registerTask('default', ['build', 'run:prod']); | ||
|
||
// Dev task - build assets, and start a dev server | ||
grunt.registerTask('dev', ['build', 'run:dev']); | ||
|
||
// Build task - minimize all assets | ||
grunt.registerTask('build', ['newer:ngAnnotate:build', 'newer:uglify:build', 'newer:cssmin:build', 'newer:imagemin:build', 'newer:copy']); | ||
|
||
} |
This file was deleted.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.