简体   繁体   English

我不希望资产单调地将我的JavaScript开发

[英]I dont want assetic to oneline my javascript in dev

I am using Assetic with a symfony2 application which mostly works fine. 我正在使用带有symfony2应用程序的Assetic,该应用程序通常都能正常工作。 One thing that is bugging me though is that in the dev enviroment (app_dev.php) assetic onelines my javascript files. 令我烦恼的一件事是,在开发环境(app_dev.php)中,资产资产支持我的javascript文件。 This is a pain in the ass to debug. 这是调试的麻烦。 (Guess what : the error is on line 1 ... duhh ) (猜猜是什么:错误在第1行上……duhh)

Is there a way to tell Assetic not to oneline the js files in the dev enviroment ? 有没有办法告诉Assetic不要在开发环境中将js文件放在一行?

For the moment I have : (config.yml) 目前,我有:(config.yml)

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ ]
   # java: /usr/bin/java
    filters:
        cssrewrite: ~
        # closure:
        #     jar: %kernel.root_dir%/java/compiler.jar
        yui_css:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
        yui_js:
            jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

And in config_dev.yml : 并在config_dev.yml中:

assetic:
    use_controller: true

You should disable minification in debug mode. 您应该在调试模式下禁用缩小。 See this document for more info: 有关更多信息,请参见此文档:

http://symfony.com/doc/master/cookbook/assetic/yuicompressor.html#disable-minification-in-debug-mode http://symfony.com/doc/master/cookbook/assetic/yuicompressor.html#disable-minification-in-debug-mode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我想给我的javascript函数添加延迟,但是不知道如何 - I want to add a delay to my javascript function but dont know how 我的JavaScript出现问题,我不想验证 <select>被禁用的标签 - Problems with my javascript, I dont want to validate <select> tags that are disabled 我的javascript执行后页面重新加载,我不想要它 - Page reloads after my javascript is executed, I dont want it to Assetic:如何仅在开发环境中包含javascript文件? - Assetic: how to include javascript file only for dev environment? 为什么在资产中找不到我的JavaScript文件? - Why are my javascript files not being found in assetic? 出乎意料; 在我的JavaScript中我不明白为什么 - Unexpected ; in my javascript I dont understand why 我不知道为什么我的 setInterval 不起作用 javascript - I dont know why my setInterval is not working javascript 隐藏导航栏在滚动时不隐藏,我希望它在我通过 javascript 滚动时切换 - hide nav bar dont hide when scrolling and i want it toggle when i scroll by javascript 我有一个场景,如果url不工作,我不想运行我的测试用例 - I am having one scenario, If url was not working than i dont want to run my Test cases 如何打印“ a / b”,其中a和b是JavaScript中的数值。 我不想打印结果值 - how to print “a/b” where a and b are numeric value in JavaScript. I dont want to print the resultant value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM