Grails sass资产管道不适用于生产

时间:2016-08-23 07:50:04

标签: grails asset-pipeline assets grails-3.1

我在我的项目中使用sass-asset-pipeline插件和sass。开发中的一切都按预期工作。但是,在生产中,我的css和js资产未正确加载到我的项目中。

的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";

我的制作演示还显示了一个奇怪的错误,名为messages.js的文件丢失,而我的项目中没有这样的javascript文件。

任何想法都会受到欢迎。

在生产中只加载了application.css和application.js,但是例如grails.css,theme.scss和bootstrap.js都没有。

0 个答案:

没有答案