vite-plugin-libcss icon indicating copy to clipboard operation
vite-plugin-libcss copied to clipboard

Handle nested directories within dist folder

Open rahulbhanushali opened this issue 1 year ago • 0 comments

Problem

The current version of the library assumes that the ES module file is at the root (/dist) folder and injects the CSS import statement. This import fails to work when vite build generates ES modules within nested directories.

For e.g. if the ES module is outputted to dist/js/ the current import fails.

This commit adds the CSS import statement correctly with respect to the depth of the ES module within dist folder.

Changes

  1. Correctly setup the path for the import statement of the ES module where it is being imported.

rahulbhanushali avatar Mar 01 '24 06:03 rahulbhanushali