Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-sprite-loader

Package Overview
Dependencies
Maintainers
4
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-sprite-loader - npm Package Compare versions

Comparing version 5.2.1 to 6.0.0

16

CHANGELOG.md

@@ -5,2 +5,18 @@ # Change Log

<a name="6.0.0"></a>
# [6.0.0](https://github.com/JetBrains/svg-sprite-loader/compare/v5.2.1...v6.0.0) (2021-03-13)
### Bug Fixes
* **additional-assets:** adds missing method ([8db9c4d](https://github.com/JetBrains/svg-sprite-loader/commit/8db9c4d))
* **loader:** get rid of webpack--version ([54a0c6b](https://github.com/JetBrains/svg-sprite-loader/commit/54a0c6b)), closes [#437](https://github.com/JetBrains/svg-sprite-loader/issues/437) [#417](https://github.com/JetBrains/svg-sprite-loader/issues/417)
### BREAKING CHANGES
* **loader:** delete get-webpack-version.js
<a name="5.2.1"></a>

@@ -7,0 +23,0 @@ ## [5.2.1](https://github.com/JetBrains/svg-sprite-loader/compare/v5.2.0...v5.2.1) (2020-12-14)

7

examples/base-webpack.config.js
const path = require('path');
const packageName = require('../package.json').name;
const { getWebpackVersion } = require('../lib/utils');
const webpackVersion = getWebpackVersion();
const config = {

@@ -27,6 +24,2 @@ output: {

if (webpackVersion >= 4) {
config.mode = 'development';
}
module.exports = config;

16

lib/plugin.js

@@ -12,4 +12,3 @@ /* eslint-disable import/no-extraneous-dependencies */

replaceSpritePlaceholder,
getMatchedRule,
getWebpackVersion
getMatchedRule
} = require('./utils');

@@ -81,8 +80,8 @@

.tap(NAMESPACE, () => this.afterOptimizeChunks(compilation));
if (!getWebpackVersion.IS_5) {
compilation.hooks
.optimizeExtractedChunks
.tap(NAMESPACE, chunks => this.optimizeExtractedChunks(chunks));
}
compilation.hooks
.optimizeExtractedChunks
.tap(NAMESPACE, chunks => this.optimizeExtractedChunks(chunks));
compilation.hooks
.additionalAssets

@@ -173,3 +172,4 @@ .tapPromise(NAMESPACE, () => {

source() { return content; },
size() { return content.length; }
size() { return content.length; },
updateHash(bulkUpdateDecorator) { bulkUpdateDecorator.update(content); }
};

@@ -176,0 +176,0 @@ });

@@ -15,3 +15,3 @@ let ConcatenatedModule;

function getAllModules(compilation) {
let modules = compilation.modules;
let modules = Array.from(compilation.modules);

@@ -18,0 +18,0 @@ // Look up in child compilations

/* eslint-disable global-require */
const getWebpackVersion = require('./get-webpack-version');
let getMatchedRule = null;
if (getWebpackVersion.IS_5) {
// webpack5 and upper
try {
getMatchedRule = require('./get-matched-rule-4');
} catch (e) {
getMatchedRule = require('./get-matched-rule-5');
} else {
// webpack4 and lower
getMatchedRule = require('./get-matched-rule-4');
}
module.exports = getMatchedRule;

@@ -7,3 +7,2 @@ module.exports.generateExport = require('./generate-export');

module.exports.getModuleChunk = require('./get-module-chunk');
module.exports.getWebpackVersion = require('./get-webpack-version');
module.exports.getMatchedRule = require('./get-matched-rule');

@@ -10,0 +9,0 @@ module.exports.isModuleShouldBeExtracted = require('./is-module-should-be-extracted');

{
"name": "svg-sprite-loader",
"version": "5.2.1",
"version": "6.0.0",
"description": "Webpack loader for creating SVG sprites",

@@ -103,7 +103,7 @@ "keywords": [

"test:all": "yarn test:webpack-2 && yarn test:webpack-3 && yarn test:webpack-4",
"test:webpack-2": "yarn env webpack-2 && yarn test",
"test:webpack-3": "yarn env webpack-3 && yarn test",
"test:webpack-4": "yarn env webpack-4 && yarn test",
"test:webpack-2": "yarn env webpack-2 && env WEBPACK_VERSION=2 yarn test",
"test:webpack-3": "yarn env webpack-3 && env WEBPACK_VERSION=3 yarn test",
"test:webpack-4": "yarn env webpack-4 && env WEBPACK_VERSION=4 yarn test",
"upload-coverage": "codeclimate-test-reporter < coverage/lcov.info"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc