vite-plugin-libcss
vite-plugin-libcss copied to clipboard
Handle nested directories within dist folder
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
- Correctly setup the path for the import statement of the ES module where it is being imported.