Skip to content

Commit

Permalink
Merge pull request #69 from fleetbase/dev-v0.2.28
Browse files Browse the repository at this point in the history
import leaflet assets direct to vendor
  • Loading branch information
roncodes authored Sep 16, 2024
2 parents 3378cd0 + 844fc38 commit b093761
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
30 changes: 9 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,37 +57,25 @@ module.exports = {
app.options = app.options || {};
app.options.postcssOptions = postcssOptions;

if (!app.__leafletIncluded) {
app.__leafletIncluded = true;
this.import('node_modules/leaflet/dist/leaflet-src.js');
this.import('node_modules/leaflet/dist/leaflet.css');
}

// Import the `intlTelInput.min.css` file and append it to the parent application's `vendor.css`
this.import('node_modules/intl-tel-input/build/css/intlTelInput.min.css');
},

treeForLeaflet: function () {
const trees = [];
const leafletImagesPath = path.join(this.pathBase('leaflet'), 'dist', 'images');
const alwaysExclude = ['LICENSE', 'package.json', 'example.html'];
const leafletAddons = [{ package: 'leaflet', include: ['leaflet-src.js'], exclude: [...alwaysExclude], path: ['dist'] }];

for (let i = 0; i < leafletAddons.length; i++) {
const leafletAdddon = leafletAddons[i];
const leafletAddonDist = path.join(this.pathBase(leafletAdddon.package), ...leafletAdddon.path);

trees.push(
new Funnel(leafletAddonDist, {
destDir: 'leaflet',
include: leafletAdddon.include,
exclude: leafletAdddon.exclude,
getDestinationPath: leafletAdddon.getDestinationPath,
})
);
}

trees.push(
const trees = [
new Funnel(leafletImagesPath, {
srcDir: '/',
destDir: '/leaflet-images',
allowEmpty: true,
})
);
}),
];

return trees;
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/ember-ui",
"version": "0.2.27",
"version": "0.2.28",
"description": "Fleetbase UI provides all the interface components, helpers, services and utilities for building a Fleetbase extension into the Console.",
"keywords": [
"fleetbase-ui",
Expand Down

0 comments on commit b093761

Please sign in to comment.