Skip to content

amay/web-app-manifest-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status npm

web-app-manifest-loader

Load images referenced in the icons and splash_screens fields in your Web App Manifest using webpack.

$ npm install --save-dev web-app-manifest-loader

Usage

Documentation: Using loaders

In your webpack config:

module: {
  loaders: [
    {
      test: /manifest.json$/,
      loader: 'file-loader?name=manifest.json!web-app-manifest-loader'
    }
  ]
}

Note that this example also uses file-loader.

Then, require the manifest in your application code:

require('./manifest.json');

This allows you to provide image paths in the standard webpack format inside your manifest:

{
  "name": "Hello World",
  ...
  "splash_screens": [
    {
      "src": "./images/splash-hi.png",
      "sizes": "2560x1440",
      "type": "image/png"
    },
    ...
  ],
  "icons": [
    {
      "src": "./images/icon-hi.png",
      "sizes": "512x512",
      "type": "image/png"
    },
    ...
  ]
}

License

MIT License

About

Web app manifest loader for webpack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%