I am using sass-asset-pipeline plugin and sass in my project. Everything works as expected in devel. However, in production my css and js assets are not loaded properly into my project.
Build.gradle
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.11.1"
classpath "com.bertramlabs.plugins:sass-asset-pipeline:2.11.1"
classpath "org.grails.plugins:hibernate4:5.0.10"
}
}
version "0.1"
group "client.portal"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"org.grails.grails-gsp"
apply plugin:"asset-pipeline"
apply plugin:"jacoco"
ext {
grailsVersion = project.grailsVersion
gradleWrapperVersion = project.gradleWrapperVersion
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://dl.bintray.com/animator013/plugins"}
}
dependencyManagement {
imports {
mavenBom "org.grails:grails-bom:$grailsVersion"
}
applyMavenExclusions false
}
final SELENIUM_VERSION = "2.53.0"
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:scaffolding"
compile "org.grails.plugins:hibernate4"
compile "org.hibernate:hibernate-ehcache"
console "org.grails:grails-console"
profile "org.grails.profiles:web"
runtime "com.h2database:h2"
testCompile "org.grails:grails-plugin-testing"
testCompile "org.grails.plugins:geb"
// testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.52.0"
testRuntime 'org.apache.httpcomponents:httpcore:4.4.4'
testRuntime "org.seleniumhq.selenium:selenium-support:$SELENIUM_VERSION"
testRuntime "org.seleniumhq.selenium:selenium-firefox-driver:$SELENIUM_VERSION"
compile 'org.grails.plugins:mail:2.0.0.RC6'
compile 'org.grails.plugins:asynchronous-mail:2.0.0.RC4'
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.1"
runtime 'com.bertramlabs.plugins:sass-asset-pipeline:2.11.1'
runtime 'org.grails.plugins:i18n-asset-pipeline:2.0.0'
}
Application.css:
/*
* some text
*
*= require grails
*= require main
*= require mobile
*= require theme
*/
Theme.scss:
@import "bootstrap/variables";
@import "bootstrap/mixins";
// Reset and dependencies
@import "bootstrap/normalize";
@import "bootstrap/print";
@import "bootstrap/glyphicons";
// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/grid";
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";
// Components
@import "bootstrap/component-animations";
@import "bootstrap/dropdowns";
@import "bootstrap/button-groups";
@import "bootstrap/input-groups";
@import "bootstrap/navs";
@import "bootstrap/navbar";
@import "bootstrap/breadcrumbs";
@import "bootstrap/pagination";
@import "bootstrap/pager";
@import "bootstrap/labels";
@import "bootstrap/badges";
@import "bootstrap/jumbotron";
@import "bootstrap/thumbnails";
@import "bootstrap/alerts";
@import "bootstrap/progress-bars";
@import "bootstrap/media";
@import "bootstrap/list-group";
@import "bootstrap/panels";
@import "bootstrap/responsive-embed";
@import "bootstrap/wells";
@import "bootstrap/close";
// Components w/ JavaScript
@import "bootstrap/modals";
@import "bootstrap/tooltip";
@import "bootstrap/popovers";
@import "bootstrap/carousel";
// Utility classes
@import "bootstrap/utilities";
@import "bootstrap/responsive-utilities";
// Theme classes
@import "variable";
@import "footer";
@import "header";
My production demo also shows a weird error that file called messages.js is missing, while I dont have such javascript file in my project.
Any idea, what could be wrong is welcomed.
Only application.css and application.js is loaded in production, but for example grails.css, theme.scss and bootstrap.js are not.