@shopify/webpack-asset-metadata-plugin
v3.1.0
Published
Generates a webpack asset metadata file containing subresource integrity SHAs
Downloads
20,803
Maintainers
Keywords
Readme
@shopify/webpack-asset-metadata-plugin
Webpack plugin use to generate manifest file.
Installation
$ yarn add @shopify/webpack-asset-metadata-plugin
Usage
import {AssetMetadataPlugin} from '@shopify/webpack-asset-metadata-plugin';
const compiler = webpack({
plugins: [
new AssetMetadataPlugin(
{name: 'baseline'},
{
filename: 'assets.json',
assetBasePath: path.resolve(buildDir, '..'),
includeIntegrity: true,
},
),
],
});
Options
identifier
A target name required. Display directly in the manifest file.
export interface ManifestIdentifier {
locales?: string[];
target: string;
}
browsers
Optional. Display directly in the manifest file.
assetBasePath
Optional. Default value 'false'.
Use if asset location is different from webpack setup. (ie. in Rails+React project it is public
)
filename
Optional. Default value 'assets.json'.
The name of the manifest file, often chaned to sewing-kit-manifest.json
includeIntegrity
Optional. Default value 'false'. This value is typically set to true for production mode.