Skip to content

Improve output directory structure #1124

@datho7561

Description

@datho7561

Describe the bug

See the discussion on #1104

The compiled code is split between two folders:

  • ./out for the code compiled to CommonJS modules as well as a compiled copy of the test code
  • ./lib for the code compiled to UMD modules and to ESM modules

Notably, the relative paths to ./l10n from the CommonJS server.js and the UMD and ESM server.js are different. This means that the localization information will not be loaded properly when running with the compiled UMD or ESM code.

Making changes to the output directory structure could break projects that consume yaml-language-server, but the current structure is confusing and causing problems.

Expected Behavior

  1. There should be one "output" folder for the compiled code
  2. The relative path from server.js to ./l10n for CJS, UMD, and ESM should be the same

Current Behavior

  1. There are two output folders: out and lib
  2. The relative path from server.js to ./l10n for CJS is ../../../l10n and for UMD and ESM it's ../../l10n

Steps to Reproduce

  1. Compile the code npm run compile; npm run compile:esm; npm run compile:umd
  2. Observe the directory structure of the output code

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

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