mirror of
https://github.com/ionic-team/ionicons.git
synced 2026-11-30 16:48:16 +01:00
Also provide ionicons as a custom element which can be defined using `customElements.define()`
```
import { IonIcon } from "ionicons/components/ion-icon";
customElements.define("ion-icon", IonIcon);
```
The custom element build works the same as the lazy load build, and is also able to lazy load svgs on demand, either by giving it an exact url in the `src` attribute `<ion-icon src="./path/to/airplane.svg"></ion-icon>`, or by providing the name of the ionicon to load `<ion-icon name="airplane"></ion-icon>`.
If using the `name` attribute, you'll also need to set where to find the svg directory using `setAssetPath()`
```
import { setAssetPath } from "ionicons/components";
setAssetPath(location.href);
```
75 lines
1.8 KiB
JSON
Executable File
75 lines
1.8 KiB
JSON
Executable File
{
|
|
"name": "ionicons",
|
|
"version": "5.4.0",
|
|
"description": "Premium icons for Ionic.",
|
|
"files": [
|
|
"dist/",
|
|
"icons/"
|
|
],
|
|
"main": "./dist/index.cjs.js",
|
|
"module": "./dist/index.js",
|
|
"types": "dist/types/index.d.ts",
|
|
"unpkg": "dist/ionicons.js",
|
|
"collection": "dist/collection/collection-manifest.json",
|
|
"collection:main": "dist/collection/index.js",
|
|
"scripts": {
|
|
"build": "tsc -p scripts/tsconfig.json && npm run build.files && npm run build.component && npm run collection.copy",
|
|
"build.files": "node scripts/build.js",
|
|
"build.component": "stencil build",
|
|
"collection.copy": "node scripts/collection-copy.js",
|
|
"start": "stencil build --dev --watch --serve",
|
|
"test": "stencil test --spec",
|
|
"release": "np --no-2fa",
|
|
"version": "npm run build"
|
|
},
|
|
"dependencies": {
|
|
"@stencil/core": "^2.4.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/fs-extra": "^9.0.6",
|
|
"@types/jest": "^26.0.20",
|
|
"@types/node": "^14.14.22",
|
|
"@types/svgo": "^1.3.3",
|
|
"fs-extra": "^9.1.0",
|
|
"jest": "^26.6.3",
|
|
"jest-cli": "^26.6.3",
|
|
"np": "^7.2.0",
|
|
"svgo": "1.3.2",
|
|
"typescript": "^4.1.3"
|
|
},
|
|
"keywords": [
|
|
"icon pack",
|
|
"ionic",
|
|
"icon",
|
|
"svg",
|
|
"mobile",
|
|
"web component",
|
|
"component",
|
|
"custom element",
|
|
"material design",
|
|
"ios"
|
|
],
|
|
"homepage": "http://ionicons.com/",
|
|
"author": {
|
|
"name": "Ben Sperry",
|
|
"web": "https://twitter.com/benjsperry"
|
|
},
|
|
"contributors": [
|
|
{
|
|
"name": "Adam Bradley",
|
|
"web": "http://twitter.com/adamdbradley"
|
|
}
|
|
],
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/ionic-team/ionicons.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/ionic-team/ionicons/issues"
|
|
},
|
|
"license": "MIT",
|
|
"sideEffects": [
|
|
"icons/imports/"
|
|
]
|
|
}
|