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

svgo-loader

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svgo-loader - npm Package Compare versions

Comparing version 3.0.3 to 4.0.0

.github/workflows/ci.yaml

13

example/basic/webpack.config.js

@@ -7,3 +7,4 @@ module.exports = {

path: __dirname + "/dist",
filename: "bundle.js"
filename: "bundle.js",
assetModuleFilename: '[name][ext]'
},

@@ -14,10 +15,4 @@ module: {

test: /\.svg$/,
use: [
{
loader: 'file-loader'
},
{
loader: '../../index.js',
}
]
type: 'asset/resource',
loader: '../../index.js',
}

@@ -24,0 +19,0 @@ ]

@@ -7,3 +7,4 @@ module.exports = {

path: __dirname + "/dist",
filename: "bundle.js"
filename: "bundle.js",
assetModuleFilename: "[name][ext]"
},

@@ -14,13 +15,7 @@ module: {

test: /\.svg$/,
use: [
{
loader: "file-loader"
},
{
loader: "../../index.js",
options: {
configFile: './svgo.config.js'
}
}
]
type: "asset/resource",
loader: "../../index.js",
options: {
configFile: './svgo.config.js'
}
}

@@ -27,0 +22,0 @@ ]

@@ -7,3 +7,4 @@ module.exports = {

path: __dirname + "/dist",
filename: "bundle.js"
filename: "bundle.js",
assetModuleFilename: "[name][ext]"
},

@@ -14,10 +15,4 @@ module: {

test: /\.svg$/,
use: [
{
loader: 'file-loader'
},
{
loader: '../../index.js',
}
]
type: 'asset/resource',
loader: '../../index.js'
}

@@ -24,0 +19,0 @@ ]

const { optimize, loadConfig } = require('svgo');
const loaderUtils = require('loader-utils');
async function loader(source) {
const { configFile, ...options } = loaderUtils.getOptions(this) || {};
const { configFile, ...options } = this.getOptions();
let config;

@@ -13,5 +12,2 @@ if (typeof configFile === 'string') {

const result = optimize(source, { path: this.resourcePath, ...config, ...options });
if (result.error) {
throw Error(result.error);
}
return result.data;

@@ -18,0 +14,0 @@ }

{
"name": "svgo-loader",
"version": "3.0.3",
"version": "4.0.0",
"description": "svgo loader for webpack",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node --test"
},

@@ -24,10 +24,8 @@ "repository": {

"devDependencies": {
"file-loader": "^2.0.0",
"webpack": "^4.17.2",
"webpack-cli": "^3.1.0"
"webpack": "^5.0.0",
"webpack-cli": "^5.0.0"
},
"dependencies": {
"loader-utils": "^2.0.3",
"svgo": "^2.8.0"
"svgo": "^3.0.0"
}
}

@@ -26,10 +26,4 @@ # [svgo](https://github.com/svg/svgo) loader for [webpack](https://github.com/webpack/webpack)

test: /\.svg$/,
use: [
{
loader: 'file-loader'
},
{
loader: 'svgo-loader',
}
]
type: 'asset',
loader: 'svgo-loader'
}

@@ -53,13 +47,7 @@ ]

test: /\.svg$/,
use: [
{
loader: 'file-loader'
},
{
loader: 'svgo-loader',
options: {
configFile: './scripts/svgo.config.js'
}
}
]
type: 'asset',
loader: 'svgo-loader',
options: {
configFile: './scripts/svgo.config.js'
}
}

@@ -80,13 +68,7 @@ ]

test: /\.svg$/,
use: [
{
loader: 'file-loader'
},
{
loader: 'svgo-loader',
options: {
configFile: false
}
}
]
type: 'asset',
loader: 'svgo-loader',
options: {
configFile: false
}
}

@@ -107,17 +89,11 @@ ]

test: /\.svg$/,
use: [
{
loader: 'file-loader'
},
{
loader: 'svgo-loader',
options: {
multipass: true,
js2svg: {
indent: 2,
pretty: true,
}
}
type: 'asset',
loader: 'svgo-loader',
options: {
multipass: true,
js2svg: {
indent: 2,
pretty: true,
}
]
}
}

@@ -124,0 +100,0 @@ ]

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