svg-sprite-loader
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="3.2.3"></a> | ||
## [3.2.3](https://github.com/kisenka/svg-sprite-loader/compare/v3.2.2...v3.2.3) (2017-08-18) | ||
### Bug Fixes | ||
* deal with deprecation warnings from webpack 3 ([d150035](https://github.com/kisenka/svg-sprite-loader/commit/d150035)) | ||
<a name="3.2.2"></a> | ||
@@ -7,0 +17,0 @@ ## [3.2.2](https://github.com/kisenka/svg-sprite-loader/compare/v3.2.1...v3.2.2) (2017-08-17) |
@@ -7,4 +7,11 @@ /* eslint-disable import/no-extraneous-dependencies */ | ||
const { NAMESPACE } = require('./config'); | ||
const { MappedList, replaceInModuleSource, replaceSpritePlaceholder } = require('./utils'); | ||
const { | ||
MappedList, | ||
replaceInModuleSource, | ||
replaceSpritePlaceholder, | ||
getWebpackVersion | ||
} = require('./utils'); | ||
const webpackVersion = parseInt(getWebpackVersion(), 10); | ||
class SVGSpritePlugin { | ||
@@ -48,3 +55,5 @@ constructor() { | ||
chunks.forEach((chunk) => { | ||
chunk.modules | ||
const modules = webpackVersion < 3 ? chunk.modules : chunk.mapModules(); | ||
modules | ||
// dirty hack to identify modules extracted by extract-text-webpack-plugin | ||
@@ -51,0 +60,0 @@ // TODO refactor |
@@ -0,1 +1,3 @@ | ||
const webpackVersion = require('./get-webpack-version'); | ||
/** | ||
@@ -9,4 +11,10 @@ * Find nearest module chunk (not sure that is reliable method, but who cares). | ||
function getModuleChunk(module, modules) { | ||
const { chunks } = module; | ||
let chunks; | ||
if (parseInt(webpackVersion(), 10) >= 3) { | ||
chunks = module.mapChunks(); | ||
} else { | ||
chunks = module.chunks; | ||
} | ||
// webpack 1 compat | ||
@@ -13,0 +21,0 @@ const issuer = typeof module.issuer === 'string' |
{ | ||
"name": "svg-sprite-loader", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "Webpack loader for creating SVG sprites", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
1168191
26211