Skip to content

Commit

Permalink
Move requires at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Feb 28, 2021
1 parent 52a9c90 commit e0f0cd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/svg-sprite/mode/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const { format } = require('util');
const _ = require('lodash');
const SVGSpriteBase = require('./base');
const SVGSprite = require('../sprite');
const SVGSpriteCssPacker = require('./css/packer');

/**
* CSS sprite
Expand Down Expand Up @@ -282,7 +283,6 @@ SVGSpriteCss.prototype._addShapeToSimpleCssSprite = function(shape, needsRegular
* @return {SVGSpriteCss} Self reference
*/
SVGSpriteCss.prototype._layoutBinPacked = function(pseudoShapeMap) {
const SVGSpriteCssPacker = require('./css/packer');
const packer = new SVGSpriteCssPacker(this._spriter._shapes);
const positions = packer.fit();

Expand Down
2 changes: 1 addition & 1 deletion lib/svg-sprite/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const cssom = require('cssom');
const { CssSelectorParser } = require('css-selector-parser');
const phantomjs = require('phantomjs-prebuilt').path;
const async = require('async');
const cssmin = require('cssmin');

const csssel = new CssSelectorParser();
const dimensionsPhantomScript = path.resolve(__dirname, 'shape/dimensions.phantom.js');
Expand Down Expand Up @@ -727,7 +728,6 @@ SVGShape.prototype.setNamespace = function(ns) {
// Substitute ID references in <style> elements
const style = select('//svg:style', this.dom);
if (style.length) {
const cssmin = require('cssmin');
select('//svg:style', this.dom).forEach(style => {
style.textContent = cssmin(this._replaceIdAndClassnameReferences(style.textContent, substIds, substClassnames, true));
});
Expand Down

0 comments on commit e0f0cd7

Please sign in to comment.