Skip to content

chenasraf/chrome-url-loader

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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)

About

Chrome Extension URL loader for webpack - import your files normally and they will be bundled for Chrome extension releases

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project