mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
serve all css minimized & static files from /build
This commit is contained in:
parent
a6590e7d84
commit
9cc92ccb25
5 changed files with 19 additions and 14 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -7,7 +7,7 @@ config.json
|
|||
npm-debug.log
|
||||
lib
|
||||
public/bower_components
|
||||
public/build
|
||||
build
|
||||
|
||||
src/*/*.map
|
||||
src/*/*/*.map
|
||||
|
|
|
|||
18
Gruntfile.js
18
Gruntfile.js
|
|
@ -11,7 +11,7 @@ module.exports = function(grunt) {
|
|||
uglify: {
|
||||
buildApp: {
|
||||
files: {
|
||||
'public/build/app.js': [
|
||||
'build/app.js': [
|
||||
'public/bower_components/jquery/jquery.min.js',
|
||||
'public/bower_components/bootstrap-growl/jquery.bootstrap-growl.min.js',
|
||||
'public/bower_components/angular/angular.min.js',
|
||||
|
|
@ -65,7 +65,7 @@ module.exports = function(grunt) {
|
|||
},
|
||||
buildStatic: {
|
||||
files: {
|
||||
'public/build/static.js': [
|
||||
'build/static.js': [
|
||||
'public/bower_components/jquery/jquery.min.js',
|
||||
'public/bower_components/habitrpg-shared/dist/habitrpg-shared.js',
|
||||
'public/bower_components/angular/angular.min.js',
|
||||
|
|
@ -89,8 +89,8 @@ module.exports = function(grunt) {
|
|||
paths: ['public']
|
||||
},
|
||||
files: {
|
||||
'public/build/app.css': ['public/css/index.styl'],
|
||||
'public/build/static.css': ['public/css/static.styl']
|
||||
'build/app.css': ['public/css/index.styl'],
|
||||
'build/static.css': ['public/css/static.styl']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -98,15 +98,19 @@ module.exports = function(grunt) {
|
|||
cssmin: {
|
||||
build: {
|
||||
files: {
|
||||
'public/build/app.css': ['public/build/app.css'],
|
||||
'public/build/static.css': ['public/build/static.css']
|
||||
'build/app.css': ['build/app.css'],
|
||||
'build/static.css': ['build/static.css'],
|
||||
'build/bower_components/habitrpg-shared/dist/spritesheets.css': ['public/bower_components/habitrpg-shared/dist/spritesheets.css'],
|
||||
'build/bower_components/bootstrap/docs/assets/css/bootstrap.css': ['public/bower_components/bootstrap/docs/assets/css/bootstrap.css'],
|
||||
'build/bower_components/bootstrap/docs/assets/css/bootstrap-responsive.css': ['public/bower_components/bootstrap/docs/assets/css/bootstrap-responsive.css'],
|
||||
'build/bower_components/bootstrap/docs/assets/css/docs.css': ['public/bower_components/bootstrap/docs/assets/css/docs.css']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
nodemon: {
|
||||
dev: {
|
||||
ignoredFiles: ['public/*', 'Gruntfile.js', 'views/*'] // Do not work!
|
||||
ignoredFiles: ['public/*', 'Gruntfile.js', 'views/*', 'build/*'] // Do not work!
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ app.use(passport.initialize());
|
|||
app.use(passport.session());
|
||||
|
||||
app.use(app.router);
|
||||
app.use(express['static'](path.join(__dirname, "/../build")));
|
||||
app.use(express['static'](path.join(__dirname, "/../public")));
|
||||
|
||||
// development only
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@ html
|
|||
display: none;
|
||||
}
|
||||
|
||||
// CSS
|
||||
// CSS Remember to update also in Grunfile.js cssmin task!
|
||||
link(rel='stylesheet', href='/bower_components/bootstrap/docs/assets/css/bootstrap.css')
|
||||
|
||||
link(rel='stylesheet', href='/build/app.css')
|
||||
link(rel='stylesheet', href='/app.css')
|
||||
|
||||
// HabitRPG Shared
|
||||
link(rel='stylesheet', href='/bower_components/habitrpg-shared/dist/spritesheets.css')
|
||||
|
||||
- if(env.NODE_ENV == 'production'){
|
||||
script(type='text/javascript', src='build/app.js')
|
||||
script(type='text/javascript', src='/app.js')
|
||||
- }else{
|
||||
// Remember to update the file list in Gruntfile.js!
|
||||
script(type='text/javascript', src='/bower_components/jquery/jquery.min.js')
|
||||
|
|
|
|||
|
|
@ -13,17 +13,17 @@ html
|
|||
meta(charset='utf-8')
|
||||
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
||||
|
||||
// CSS
|
||||
// CSS Remember to update also in Grunfile.js cssmin task!
|
||||
link(rel='stylesheet', href='/bower_components/bootstrap/docs/assets/css/bootstrap.css')
|
||||
// Keep this out of build because the one after has some images and would like not to override it
|
||||
link(rel='stylesheet', href='/bower_components/bootstrap/docs/assets/css/bootstrap-responsive.css')
|
||||
link(href='/bower_components/bootstrap/docs/assets/css/docs.css', rel='stylesheet')
|
||||
|
||||
link(rel='stylesheet', href='/build/static.css')
|
||||
link(rel='stylesheet', href='/static.css')
|
||||
|
||||
// JS
|
||||
- if(layoutEnv.NODE_ENV == 'production'){
|
||||
script(type='text/javascript', src='/build/static.js')
|
||||
script(type='text/javascript', src='/static.js')
|
||||
- }else{
|
||||
// Remember to update the file list in Gruntfile.js!
|
||||
script(type='text/javascript', src='/bower_components/jquery/jquery.min.js')
|
||||
|
|
|
|||
Loading…
Reference in a new issue