gpt4 book ai didi

Grails uglifyjs 插件不起作用

转载 作者:行者123 更新时间:2023-12-02 15:09:05 26 4
gpt4 key购买 nike

我已将 uglifyjs 插件添加到我的项目中grails install-plugin uglify-js-minified-resources .

还添加了 compile ":uglify-js-minified-resources:0.1.1"给我的BuildConfig.groovy文件。

启动应用程序后,没有一个 js 文件被缩小。我错过了一些配置吗?
我在关注 this

我的 BuildConfig 文件

grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility

repositories {
inherits true // Whether to inherit repository definitions from plugins

grailsPlugins()
grailsHome()
grailsCentral()

mavenLocal()
mavenCentral()

mavenRepo "xxx"

}

dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.

// runtime 'mysql:mysql-connector-java:5.1.22'
runtime 'org.mybatis:mybatis-spring:1.0.2'
runtime 'org.apache.poi:poi:3.9'
}

plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.3"
runtime ":resources:1.2"
compile ":grails-melody:1.45"
compile ":uglify-js-minified-resources:0.1.1"

build ":tomcat:$grailsVersion"

runtime ":database-migration:1.3.2"

compile ':cache:1.0.1'

if (Environment.current == Environment.PRODUCTION) {
runtime ':ext-js-common:latest.release'
}
}

}

我的资源文件:
modules = { 
css {
dependsOn 'css-common'
resource url:'css/test.css'
}

utils {
dependsOn 'ext-js-core'
resource url:'js/util/test.js'

}

plugins {
dependsOn 'ext-js-core, ext-overrides, utils, plugins-common'
resource url:'js/plugins/asde.js'
}

extensions {
dependsOn 'ext-js-core, utils, ux-common'
resource url:'js/ux/treecombo/Ext.TreeCombo.js'

}

stores {
dependsOn 'ext-js-core, utils'
resource url:'js/store/store.js'

}

ui {
dependsOn 'ext-js-core, utils, ext-overrides, plugins, extensions, stores'
resource url:'js/ui/tab.ui.js'
}

}

我的 app.gsp 文件包含这些模块:
    <r:require module="css"/>   
<r:require module="utils"/>
<r:require module="plugins"/>
<r:require module="extensions"/>
<r:require module="stores"/>
<r:require module="ui"/>

最佳答案

首先确保您为正在检查的环境启用了资源插件。很多时候,我在 Dev 中意外关闭了它。您还可以打开日志记录以查看发生了什么。将以下内容添加到您的 log4j 配置中。

debug "org.grails.plugin.resource"

此外,缩小的资源只会显示在网页本身上。并且仅在使用资源插件中的标签时。

关于Grails uglifyjs 插件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19831310/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com