1.0.0 • Published 2 years ago

vite-plugin-less-tilde-import v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

vite-plugin-less-tilde-import

Add support for import less or css file in node_modules using ~ symbol in less file. for instance, @import '~packages_from_node_modules';. This kind of syntax originally supported by webpack. Therefore, some third-party component libraries use this way of importing files. I did some compatibility, now you can use this plugin to safely use ~ import symbol.

configuration

// vite.config.ts
import LessTildeImport from "vite-plugin-less-tilde-import";
import { defineConfig } from "vite";

export default defineConfig(({ command }) => {
  return {
    // ...
    css: {
      preprocessorOptions: {
        less: {
          plugins: [new LessTildeImport()],
        },
      },
    },
  };
});
1.0.0

2 years ago