Skip to content

UX Leaflet Map - Add default alias for leaflet.min.css with Webpack Encore #1524

@jonathan-stimactiv

Description

@jonathan-stimactiv

When using webpack encore, a known issues is that the css file leaflet/dist/leaflet.min.css does nos exists (and does only in jsDelivr used by the Asset Mapper component).

Is has been referenced as a known issue, and the solution is really simple: Add an alias for the file in the webpack config
https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Leaflet/README.md#unable-to-find-leafletdistleafletmincss-file-when-using-webpack-encore

I think this should be part of the recipe since the file never existed in the npm package and would be a nicer developper experience having the package work right after the installation

The following line should be added automatically by the recipe

// webpack.config.js
// ...
// uncomment if you're having problems with a jQuery plugin
//.autoProvidejQuery()

.addAliases({'leaflet/dist/leaflet.min.css': 'leaflet/dist/leaflet.css'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions