【问题标题】:what grunt task actually does the proper indent什么 grunt 任务实际上做了正确的缩进
【发布时间】:2015-05-25 11:38:19
【问题描述】:

我在我的index.html 中指定了一个区域,其中必须包含cordova/phonegap 特定的脚本...

<!-- cordova:js -->
<!-- endcordova -->

但请注意,这通常是为了如下所示:

我为此使用了grunt-replace 任务。对此的配置是动态生成的,但为了有意义,无论如何都要放下它......

replace: {
    plugins: {
        options: {
            usePrefix: false,
            patterns: [
                {
                    match: '<!-- cordova:js -->',
                    replace: '<!-- cordova:js -->;line1;line2;line3;'.replace(';', '\n')
                }
            ]
        },
        files: [
            //files you want to replace...
        ]
    }
}

最终输出如下:

我希望像下面这样正确缩进:

什么是合适的任务?

【问题讨论】:

    标签: replace gruntjs indentation


    【解决方案1】:

    在您的最终 html 上调用 grunt-jsbeautifier

    【讨论】:

      猜你喜欢
      • 2013-06-02
      • 2020-11-21
      • 2015-02-26
      • 2017-06-29
      • 2013-06-13
      • 2021-10-25
      • 2011-08-12
      • 1970-01-01
      • 2010-11-27
      相关资源
      最近更新 更多