Skip to content

Commit

Permalink
Merge pull request #66 from funbox/bugfix/config-file-path
Browse files Browse the repository at this point in the history
Fix configFilepath on Windows
  • Loading branch information
igoradamenko committed Jun 5, 2023
2 parents 3dd8f55 + c6fd570 commit 094624f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 5.0.1 (04.06.2023)

Fixed an [issue](https://github.com/funbox/optimizt/issues/63) with an incorrect path to the configuration file on Windows systems.


## 5.0.0 (19.05.2023)

Removed `removeOffCanvasPaths` plugin from SVGO config due to known bugs: [svg/svgo#1732](https://github.com/svg/svgo/issues/1732), [svg/svgo#1646](https://github.com/svg/svgo/issues/1646).
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { pathToFileURL } from 'node:url';

import checkConfigPath from './lib/checkConfigPath.js';
import convert from './lib/convert.js';
import findConfig from './lib/findConfig.js';
Expand All @@ -8,7 +10,7 @@ import prepareFilePaths from './lib/prepareFilePaths.js';
import prepareOutputPath from './lib/prepareOutputPath.js';

export default async function optimizt({ paths, avif, webp, force, lossless, verbose, output, config }) {
const configFilepath = config ? checkConfigPath(config) : findConfig();
const configFilepath = pathToFileURL(config ? checkConfigPath(config) : findConfig());
const configData = await import(configFilepath);
const preparedConfig = prepareConfig(configData);

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@funboxteam/optimizt",
"version": "5.0.0",
"version": "5.0.1",
"description": "CLI image optimization tool",
"license": "MIT",
"author": "Andrey Warkentin (https://github.com/343dev)",
Expand Down

0 comments on commit 094624f

Please sign in to comment.