Chrome Extension URL loader for webpack - import your files normally and they will be bundled for Chrome extension releases
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2022-03-07 02:09:31 +02:00
.github fix build 2022-03-07 02:09:31 +02:00
test 2022 update 2022-03-07 01:59:39 +02:00
.babelrc 2022 update 2022-03-07 01:59:39 +02:00
.gitignore fix build 2022-03-07 02:09:31 +02:00
.prettierrc 2022 update 2022-03-07 01:59:39 +02:00
index.js 2022 update 2022-03-07 01:59:39 +02:00
LICENSE Initial commit 2018-03-15 16:55:33 +02:00
package.json bump version number + release 2022-03-07 02:05:54 +02:00
README.md Default baseDir to working dir 2018-03-15 18:44:25 +02:00
yarn.lock 2022 update 2022-03-07 01:59:39 +02:00

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:

{
  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)