Skip to content

2.0.0-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@pzmosquito pzmosquito released this 16 Nov 17:20

This release changed how the Vite config is loaded. In version 1.x, this plugin loads and parses the Vite config file. This could be easier to set up for default use cases, but it also introduced the issue where the plugin has to use the require() function. This works in most setups but may not work as expected in some ESM - CJS mixed setups. To avoid this issue, version 2.x moved the responsibility of loading the Vite config to the users. The plugin will now accept the Vite config object. This means that users will have the flexibility to choose how they want to load the Vite config file suitable for their setups.

// version 1.x

settings: {
    "import/resolver": "vite"
}
// OR
settings: {
    "import/resolver": {
        vite: {
            configPath: "./app/vite.config.js",
            namedExport: "viteConfigObj"
        }
    }
}

// version 2.x

settings: {
    "import/resolver": {
        vite: {
            viteConfig: require("./vite.config").viteConfigObj,
        }
    }
}