Skip to content

Commit

Permalink
Merge pull request #115 from yooouuri/move-console-to-debug
Browse files Browse the repository at this point in the history
chore: move console.warn to debug
  • Loading branch information
jpkleemans committed Nov 21, 2023
2 parents 1ca910f + 334e5a7 commit a185be4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
6 changes: 5 additions & 1 deletion index.js
@@ -1,6 +1,9 @@
const fs = require('fs').promises
const { compileTemplate } = require('vue/compiler-sfc')
const { optimize: optimizeSvg } = require('svgo')
const _debug = require('debug')

const debug = _debug('vite-svg-loader')

module.exports = function svgLoader (options = {}) {
const { svgoConfig, svgo, defaultImport } = options
Expand Down Expand Up @@ -29,7 +32,8 @@ module.exports = function svgLoader (options = {}) {
try {
svg = await fs.readFile(path, 'utf-8')
} catch (ex) {
console.warn('\n', `${id} couldn't be loaded by vite-svg-loader, fallback to default loader`)
debug('\n', `${id} couldn't be loaded by vite-svg-loader, fallback to default loader`)

return
}

Expand Down
21 changes: 9 additions & 12 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -10,6 +10,7 @@
"main": "./index.js",
"types": "./index.d.ts",
"dependencies": {
"debug": "^4.3.4",
"svgo": "^3.0.2"
},
"devDependencies": {
Expand Down

0 comments on commit a185be4

Please sign in to comment.