Skip to content

Commit 80ebfa3

Browse files
committed
fix: don't create additional chunk for sprite
Closes: #364
1 parent d22853f commit 80ebfa3

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

lib/plugin.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
const merge = require('deepmerge');
33
const Promise = require('bluebird');
4-
const Chunk = require('webpack/lib/Chunk');
54
const SVGCompiler = require('svg-baker');
65
const spriteFactory = require('svg-baker/lib/sprite-factory');
76
const Sprite = require('svg-baker/lib/sprite');
@@ -163,10 +162,6 @@ class SVGSpritePlugin {
163162
})
164163
.then((sprite) => {
165164
const content = sprite.render();
166-
const chunkName = filename.replace(/\.svg$/, '');
167-
const chunk = new Chunk(chunkName);
168-
chunk.ids = [];
169-
chunk.files.push(filename);
170165
const filenamePrefix = this.rules.publicPath
171166
? this.rules.publicPath.replace(/^\//, '')
172167
: '';
@@ -175,8 +170,6 @@ class SVGSpritePlugin {
175170
source() { return content; },
176171
size() { return content.length; }
177172
};
178-
179-
compilation.chunks.push(chunk);
180173
});
181174
});
182175
}

0 commit comments

Comments
 (0)