Added the ability to define a public path
parent
b2408a9b2d
commit
6a79237b51
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "webpack-svg-sprite-generator",
|
||||
"version": "5.0.1",
|
||||
"version": "5.0.2",
|
||||
"description": "",
|
||||
"main": "plugin.js",
|
||||
"types": "ts/index.d.ts",
|
||||
|
|
|
@ -20,7 +20,8 @@ export interface Options {
|
|||
dtsOutputFolder: string,
|
||||
configurations: {
|
||||
[key: string] : SvgSpriteConfiguration
|
||||
}
|
||||
},
|
||||
publicPath?: string,
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,7 +123,7 @@ class SvgSpriteModule extends Module {
|
|||
|
||||
this.spriteSvg = await generateSpriteSvg(this.sprite);
|
||||
this.spriteAssetName = "sprite-" + sha1(this.spriteSvg).substr(-20) + ".svg";
|
||||
this.spriteAssetUrl = this.spriteAssetName;
|
||||
this.spriteAssetUrl = (this.pluginConfig.publicPath || "") + this.spriteAssetName;
|
||||
|
||||
this.buildInfo.assets[this.spriteAssetName] = new RawSource(this.spriteSvg);
|
||||
|
||||
|
|
Loading…
Reference in New Issue