{"id":22769672,"url":"https://github.com/planjs/webpack-upload-loader","last_synced_at":"2025-06-11T20:07:34.877Z","repository":{"id":39598905,"uuid":"282956947","full_name":"planjs/webpack-upload-loader","owner":"planjs","description":"Webpack resource upload replacement resource path","archived":false,"fork":false,"pushed_at":"2025-03-02T14:33:56.000Z","size":2055,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-18T14:44:08.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/planjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-27T16:41:09.000Z","updated_at":"2022-09-07T05:56:09.000Z","dependencies_parsed_at":"2025-04-15T03:14:19.445Z","dependency_job_id":"e5b9f564-449c-4777-a200-eeab98b81d45","html_url":"https://github.com/planjs/webpack-upload-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/planjs/webpack-upload-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planjs%2Fwebpack-upload-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planjs%2Fwebpack-upload-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planjs%2Fwebpack-upload-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planjs%2Fwebpack-upload-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/planjs","download_url":"https://codeload.github.com/planjs/webpack-upload-loader/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/planjs%2Fwebpack-upload-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259330369,"owners_count":22841619,"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-11T15:13:32.877Z","updated_at":"2025-06-11T20:07:34.830Z","avatar_url":"https://github.com/planjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @planjs/webpack-upload-loader\n\nThe `@planjs/webpack-upload-loader` resolves `import`/`require()` on a file into a remote address\n\n## Getting Started\n\nTo begin, you'll need to install `@planjs/webpack-upload-loader`:\n\n```console\n$ npm install @planjs/webpack-upload-loader --save-dev\n```\n\nImport (or `require`) the target file(s) in one of the bundle's files:\n\n**file.js**\n\n```js\nimport img from './assets/logo.png';\n```\n\nThen add the loader to your `webpack` config. For example:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.(png|jpe?g|gif)$/i,\n        use: [\n          {\n            loader: '@planjs/webpack-upload-loader',\n          },\n        ],\n      },\n    ],\n  },\n};\n```\n\n\u003e ℹ️ The current loader must be executed before `file-loader` and `url-loader`\n\n## Options\n\n### `esModule`\n\nType: `Boolean`\nDefault: `true`\n\nBy default, `@planjs/webpack-upload-loader` generates JS modules that use the ES modules syntax.\nThere are some cases in which using ES modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).\n\nYou can enable a CommonJS module syntax using:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.(png|jpe?g|gif)$/i,\n        use: [\n          {\n            loader: '@planjs/webpack-upload-loader',\n            options: {\n              esModule: true,\n            },\n          },\n        ],\n      },\n    ],\n  },\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanjs%2Fwebpack-upload-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplanjs%2Fwebpack-upload-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplanjs%2Fwebpack-upload-loader/lists"}