{"id":23674022,"url":"https://github.com/farism/gulp-elm-extract-assets","last_synced_at":"2025-12-23T05:30:11.052Z","repository":{"id":57257420,"uuid":"100912410","full_name":"farism/gulp-elm-extract-assets","owner":"farism","description":"A plugin for extracting assets from a compiled elm application","archived":false,"fork":false,"pushed_at":"2017-08-21T04:28:23.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T02:18:29.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farism.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-21T04:28:08.000Z","updated_at":"2017-08-21T04:28:24.000Z","dependencies_parsed_at":"2022-09-08T21:01:36.570Z","dependency_job_id":null,"html_url":"https://github.com/farism/gulp-elm-extract-assets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farism%2Fgulp-elm-extract-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farism%2Fgulp-elm-extract-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farism%2Fgulp-elm-extract-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farism%2Fgulp-elm-extract-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farism","download_url":"https://codeload.github.com/farism/gulp-elm-extract-assets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239706227,"owners_count":19683815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-29T12:59:01.151Z","updated_at":"2025-12-23T05:30:10.989Z","avatar_url":"https://github.com/farism.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-elm-extract-assets [![Circle CI](https://circleci.com/gh/farism/gulp-elm-extract-assets/tree/master.svg?style=svg)](https://circleci.com/gh/farism/gulp-elm-extract-assets/tree/master)\n\nGiven an compiled `.elm` file and a `tag`, this plugin will extract all assets using that `tag`. A vinyl object will be emitted for each extracted asset. Inspired by [elm-asset-path](https://github.com/NoRedInk/elm-asset-path) but trying to avoid the native requirement.\n\n#### Usage\n\n```js\nconst elmExtractAssets = require('gulp-elm-extract-assets')\n\ngulp.src('main.js')\n  .pipe(elmExtractAssets({ tag: 'AssetUrl' }))\n```\n\n#### Options\n```js\noptions = {\n  tag // (required) asset tag\n  cwd: process.cwd() // (optional) the root directory of your elm project\n}\n```\n\n#### Example\n\non the elm side\n\n```elm\n-- Main.elm\n\nmodule Main exposing (..)\n\nimport Html exposing (Html, div)\nimport Html.Attributes exposing (id, src)\nimport Assets exposing (url, elmLogo, css3Logo)\n\n\nmain : Html a\nmain =\n    div []\n        [ Html.img [ src (url elmLogo) ] []\n        , Html.img [ src (url css3Logo) ] []\n        ]\n\n```\n```elm\n-- Assets.elm\nmodule Assets exposing (..)\n\n\ntype Asset\n    = AssetUrl String\n\n\nurl : Asset -\u003e String\nurl asset =\n    case asset of\n        AssetUrl url -\u003e\n            url\n\n\nelmLogo =\n    AssetUrl \"/src/elm.png\"\n\n\ncss3Logo =\n    AssetUrl \"/src/css3.png\"\n```\n\non the gulp side\n\n```js\nconst elm = require('gulp-elm')\nconst elmExtractAssets = require('gulp-elm-extract-assets')\n\ngulp.task('build', () =\u003e {\n  return gulp.src('Main.elm')\n    .pipe(elm())\n    .pipe(elmExtractAssets({ tag: 'AssetUrl '}))\n    .pipe(imagemin())\n    .pipe(revAll())\n    .pipe(gulp.dest('build'))\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarism%2Fgulp-elm-extract-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarism%2Fgulp-elm-extract-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarism%2Fgulp-elm-extract-assets/lists"}