diff --git a/dist/img-src-placeholder.umd.cjs b/dist/img-src-placeholder.umd.cjs
deleted file mode 100644
index eb25132..0000000
--- a/dist/img-src-placeholder.umd.cjs
+++ /dev/null
@@ -1,37 +0,0 @@
-//! img-src-placeholder v1.0.2 ~~ https://github.com/center-key/img-src-placeholder ~~ MIT License
-
-(function (factory) {
- if (typeof module === "object" && typeof module.exports === "object") {
- var v = factory(require, exports);
- if (v !== undefined) module.exports = v;
- }
- else if (typeof define === "function" && define.amd) {
- define(["require", "exports", "replacer-util"], factory);
- }
-})(function (require, exports) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.imgSrcPlaceholder = void 0;
- const replacer_util_1 = require("replacer-util");
- const imgSrcPlaceholder = {
- htmlExts: ['.html', '.htm', '.php', '.aspx', '.asp', '.jsp'],
- transform(sourceFolder, targetFolder, options) {
- const defaults = {
- cd: null,
- extensions: [],
- filename: null,
- };
- const settings = { ...defaults, ...options };
- const onePixelSvg = '';
- const dataImage = 'data:image/svg+xml;base64,' + Buffer.from(onePixelSvg).toString('base64');
- const replacerSettings = {
- cd: settings.cd,
- extensions: settings.extensions.length ? settings.extensions : imgSrcPlaceholder.htmlExts,
- regex: /src=["']?#["']?/gm,
- replacement: `src="${dataImage}"`,
- };
- return replacer_util_1.replacer.transform(sourceFolder, targetFolder, replacerSettings);
- },
- };
- exports.imgSrcPlaceholder = imgSrcPlaceholder;
-});
diff --git a/package.json b/package.json
index 3659866..6728ffa 100644
--- a/package.json
+++ b/package.json
@@ -5,15 +5,14 @@
"license": "MIT",
"type": "module",
"module": "dist/img-src-placeholder.js",
- "main": "dist/img-src-placeholder.umd.cjs",
+ "main": "dist/img-src-placeholder.js",
"types": "dist/img-src-placeholder.d.ts",
"files": [
"dist"
],
"exports": {
".": {
- "import": "./dist/img-src-placeholder.js",
- "require": "./dist/img-src-placeholder.umd.cjs"
+ "import": "./dist/img-src-placeholder.js"
},
"./": "./dist/"
},
@@ -73,8 +72,6 @@
],
"build": [
"tsc",
- "tsc --module UMD --outDir build/umd",
- "copy-file build/umd/img-src-placeholder.js build/img-src-placeholder.umd.cjs",
"add-dist-header build dist"
]
},
@@ -94,8 +91,8 @@
"devDependencies": {
"@types/fancy-log": "~2.0",
"@types/node": "~20.3",
- "@typescript-eslint/eslint-plugin": "~5.59",
- "@typescript-eslint/parser": "~5.59",
+ "@typescript-eslint/eslint-plugin": "~5.60",
+ "@typescript-eslint/parser": "~5.60",
"add-dist-header": "~1.0",
"assert-deep-strict-equal": "~1.0",
"copy-file-util": "~1.0",
diff --git a/spec/mocha.spec.js b/spec/mocha.spec.js
index 14b20a0..27d534b 100644
--- a/spec/mocha.spec.js
+++ b/spec/mocha.spec.js
@@ -20,7 +20,6 @@ describe('The "dist" folder', () => {
const expected = [
'img-src-placeholder.d.ts',
'img-src-placeholder.js',
- 'img-src-placeholder.umd.cjs',
];
assertDeepStrictEqual(actual, expected);
});
@@ -82,7 +81,7 @@ describe('Executing the CLI', () => {
const run = (posix) => {
const name = Object.keys(pkg.bin).sort()[0];
const command = process.platform === 'win32' ? posix.replaceAll('\\ ', '" "') : posix;
- execSync(command.replace(name, 'node bin/cli.js'), { stdio: 'inherit' });
+ return execSync(command.replace(name, 'node bin/cli.js'), { stdio: 'inherit' });
};
it('creates the expected file with the correct placeholder', () => {