Skip to content

Commit 5cf61eb

Browse files
author
Alexandru Badiu
committed
fix(build): Updated build.
Updated the build.
1 parent 7a44b07 commit 5cf61eb

File tree

14 files changed

+51
-10
lines changed

14 files changed

+51
-10
lines changed

dist/index.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
import { readdirSync, accessSync, constants } from 'fs';
2-
import { resolve } from 'path';
3-
import sharp from 'sharp';
4-
import async from 'async';
1+
'use strict';
2+
3+
var _fs = require('fs');
4+
5+
var _path = require('path');
6+
7+
var _sharp = require('sharp');
8+
9+
var _sharp2 = _interopRequireDefault(_sharp);
10+
11+
var _async = require('async');
12+
13+
var _async2 = _interopRequireDefault(_async);
14+
15+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
516

617
module.exports = class ImageCache {
718
/**
@@ -16,7 +27,7 @@ module.exports = class ImageCache {
1627
this.actions = {};
1728
this.pluginNames = [];
1829

19-
readdirSync(resolve(__dirname, './plugins/')).forEach(file => {
30+
(0, _fs.readdirSync)((0, _path.resolve)(__dirname, './plugins/')).forEach(file => {
2031
let name;
2132
let plugin;
2233

@@ -73,7 +84,7 @@ module.exports = class ImageCache {
7384
let sharpInstance;
7485

7586
try {
76-
sharpInstance = sharp(image);
87+
sharpInstance = (0, _sharp2.default)(image);
7788
} catch (sharpErr) {
7889
callback(sharpErr);
7990
}
@@ -83,7 +94,7 @@ module.exports = class ImageCache {
8394
return sharpInstance.metadata().then(info => {
8495
metadata = info;
8596

86-
async.each(preset.actions, (action, asyncCallback) => {
97+
_async2.default.each(preset.actions, (action, asyncCallback) => {
8798
if (!this.actions[action.action]) {
8899
return asyncCallback(new Error(`Action ${action.action} for preset ${presetName} not found in loaded plugins.`));
89100
}

dist/plugins/_converters.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
/* eslint no-bitwise: ["error", { "allow": ["~"] }] */
24
const S = require('string');
35

dist/plugins/blur.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.blur = (image, metadata, config, callback) => {

dist/plugins/define_canvas.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import sharp from 'sharp';
1+
'use strict';
2+
3+
var _sharp = require('sharp');
4+
5+
var _sharp2 = _interopRequireDefault(_sharp);
6+
7+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28

39
module.exports = {
410
attach: function attach(app) {
511
app.actions.define_canvas = (image, metadata, config, callback) => {
6-
const canvas = sharp(null, {
12+
const canvas = (0, _sharp2.default)(null, {
713
create: {
814
width: config.width,
915
height: config.height,

dist/plugins/file.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
'use strict';
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.file = (image, metadata, config, callback) => {
46
const filepath = config.path;
57

68
const options = {
7-
gravity: config.gravity,
9+
gravity: config.gravity || 'center',
810
tile: config.tile || false,
911
cutout: config.cutout || false
1012
};

dist/plugins/flip.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.flip = (image, metadata, config, callback) => {

dist/plugins/gamma.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.gamma = (image, metadata, config, callback) => {

dist/plugins/greyscale.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.greyscale = (image, metadata, config, callback) => {

dist/plugins/negate.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.negate = (image, metadata, config, callback) => {

dist/plugins/normalize.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
module.exports = {
24
attach: function attach(app) {
35
app.actions.normalize = (image, metadata, config, callback) => {

0 commit comments

Comments
 (0)