Skip to content

[Bug]: dist CSS is not mapped in package.json #771

@Jean85

Description

@Jean85

Bug description

I'm trying to use this package with the Symfony Asset Mapper, which leverages ESM loading to avoid Node/npm as a requirement. This seems to work well with your package, except for the fact that the CSS dist file is not mapped in the package.json, so ESM does not see that.

Expected behavior

CSS is included in the package, so that CDNs like jsDelivr will consider it and add to the needed files.

Steps to reproduce

  1. Go to jsDelivr
  2. Click on ESM mode button
  3. See that only the JS file is imported:
<script type="module"> 
    import tomSelect from 'https://cdn.jsdelivr.net/npm/tom-select@2.3.1/+esm'
</script>

Additional context

The Symfony docs refer to the package.json configuration file as a way to fix this; we probably need to add keys like sass or style to the root of the package.json, like Bootstrap does: https://github.com/twbs/bootstrap/blob/e3e00b5002139adb0d5dadd6002e15b7b6cd371f/package.json#L40

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions