Skip to content

Enable preprocessing or pre-js/post-js files  #21226

Closed
@sbc100

Description

@sbc100

There are time when we it would be really nice to use the preprocessor in pre/post-js files.

I enabled this in #18525, but it got reverted in #19006 because not all JS files are pre-processor safe. For example, it turns out that using private JS fields confuses the pre-processor because they start with hash symbol (#). You can also imagine JS files that have {{{ or # embedded in strings.

So, we need to find a way to enable the pre-processor, but perhaps not by default? Some kind of opt-in mechansim.

Options:

  1. A new set of arguments such as --pre-js-processed= / --post-js-processed=?
  2. Some kind of marker at the top of the file? Something like use strict;? e.g. use preprocessor;?
  3. Based on file extension
  4. Some other option.

So far I'm leaning towards (2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions