vbenjs / vite-plugin-compression

Use gzip or brotli to compress resources
MIT License
404 stars 31 forks source link

Error when importing from 'debug' #13

Closed dchenk closed 2 years ago

dchenk commented 2 years ago

I just added version 0.5.0 to a project with Vite at 2.7.10 but I'm getting the following error on build:

import { debug as debug$1 } from 'debug';
         ^^^^^
SyntaxError: Named export 'debug' not found. The requested module 'debug' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'debug';
const { debug: debug$1 } = pkg;

The source of the error is the file node_modules/vite-plugin-compression/dist/index.mjs.