代码之家  ›  专栏  ›  技术社区  ›  Shawn

客户端库js中注释的语法是什么。txt文件?

  •  4
  • Shawn  · 技术社区  · 8 年前

    向客户端库添加注释的语法是什么 js.txt css.txt 文件

    出现 一行以 # 作为一个评论,它 出现 一行以 // 用作评论。但是 /* */ 构建库时,块会导致异常。自从 #base=[root] special meaning 这让我想知道 # 真正地 添加评论的适当方式,或者如果是为了其他目的。这让我想知道 // 真正地 如果AEM只是将其视为不存在的文件的相对路径,则可以进行注释。

    任何人都知道js中注释的适当语法的最终答案。txt或css。客户端库的txt文件?

    2 回复  |  直到 8 年前
        1
  •  2
  •   Jens    7 年前

    这个 # 在clientlibs中的注释中使用是安全的 js.txt css.txt 例如,Adobe将此用作其版权免责声明:

    ###############################################################################
    # Copyright 2016 Adobe Systems Incorporated
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #     http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    ###############################################################################
    
    #base=./js
    modals.js
    

    我们零售 GitHub上的演示属性: We Retail Clientlib Example on www.github.com

        2
  •  0
  •   Unheilig Adonis González    7 年前
    (hash) Import-Package: *
    

    我们必须在导入或导出包时取消注释这些行。但在js的情况下保持相同。txt或css.txt:

    (hash)base=js
    

    所以( hash )是评论的方式,但有时不是评论。