https://github.com/chenasraf/chrome-url-loader
Chrome Extension URL loader for webpack - import your files normally and they will be bundled for Chrome extension releases
https://github.com/chenasraf/chrome-url-loader
chrome-extension loader webpack
Last synced: 11 months ago
JSON representation
Chrome Extension URL loader for webpack - import your files normally and they will be bundled for Chrome extension releases
- Host: GitHub
- URL: https://github.com/chenasraf/chrome-url-loader
- Owner: chenasraf
- License: apache-2.0
- Created: 2018-03-15T14:55:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-13T21:24:31.000Z (almost 3 years ago)
- Last Synced: 2024-09-17T03:06:41.225Z (over 1 year ago)
- Topics: chrome-extension, loader, webpack
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/chrome-url-loader
- Size: 365 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# chrome-url-loader
Chrome Extension URL loader for webpack.
This loader links to the file appropriately, using `chrome.extension.getURL` and also creates
the file for you in the specified output dir.
### Usage
Use the loader as you would any other one, specify the test files and options:
```javascript
{
loader: require.resolve('chrome-url-loader'),
test: /\.(png|svg|jpe?g|bmp|gif)/i,
options: {
publicDir: 'build/static/images',
baseDir: paths.appSrc
}
}
```
### Options
- **baseDir** *(optional)* - Your absolute source root directory (e.g. `/path/to/src`). Defaults to current working directory.
- **publicDir** - The output dir to save the file to (e.g. `build/static/media`)