Skip to content

Commit

Permalink
Merge pull request #130 from jpkleemans/revert-esm-imports
Browse files Browse the repository at this point in the history
Revert ESM imports
  • Loading branch information
jpkleemans authored Nov 20, 2023
2 parents 1b554ee + b1d7d3a commit 5159aa9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion example/package-lock.json

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

10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import fs from 'fs/promises'
import { optimize as optimizeSvg } from 'svgo'
import { compileTemplate } from 'vue/compiler-sfc'
const fs = require('fs').promises
const { compileTemplate } = require('vue/compiler-sfc')
const { optimize: optimizeSvg } = require('svgo')

function svgLoader (options = {}) {
module.exports = function svgLoader (options = {}) {
const { svgoConfig, svgo, defaultImport } = options

const svgRegex = /\.svg(\?(raw|component|skipsvgo))?$/
Expand Down Expand Up @@ -59,4 +59,4 @@ function svgLoader (options = {}) {
}
}

export default svgLoader
module.exports.default = module.exports
4 changes: 2 additions & 2 deletions package-lock.json

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "vite-svg-loader",
"version": "5.0.1",
"version": "5.1.0",
"description": "Vite plugin to load SVG files as Vue components",
"keywords": [
"vite",
"vue",
"svg"
],
"type": "module",
"main": "./index.js",
"types": "./index.d.ts",
"dependencies": {
Expand Down

0 comments on commit 5159aa9

Please sign in to comment.