代码之家  ›  专栏  ›  技术社区  ›  JJS Joel Coehoorn

如何在模具中获取基URL?

  •  0
  • JJS Joel Coehoorn  · 技术社区  · 7 年前

    https://stencil.bigcommerce.com/docs/settings-object .

    1 回复  |  直到 7 年前
        1
  •  0
  •   JJS Joel Coehoorn    7 年前
    content=content.replace(regex,“); https://github.com/bigcommerce/stencil cli/commit/fb9611502613f00a364a8d9ea4e1d351c834d08

    回答/铅笔回答.js l79-l85]

    regex = new RegExp(internals.escapeRegex(context.settings.base_url), 'g');
    content = content.replace(regex, '');
    

    此提交使用的值为 request.info.host https://github.com/bigcommerce/stencil-cli/commit/fb9611502613f00a364a8d9ea4e1d3351c834d08

    https://github.com/bigcommerce/stencil-cli/pull/396