vite-plugin-dynamic-base
English | 简体中文
- 🦾 Resolve all resource files dynamic publicPath, like Webpack's
__webpack_public_path__
.
Installation
npm i vite-plugin-dynamic-base -D
Changelog
1.0.0
2023-06-07
Feat
Changelogs
Build Mode
Compatible plugins
Usage
import { dynamicBase } from 'vite-plugin-dynamic-base'
export default defineConfig({
base: process.env.NODE_ENV === "production" ? "/__dynamic_base__/" : "/",
plugins: [
dynamicBase({ }),
],
})
Configuration
The following show the default values of the configuration
dynamicBase({
publicPath: 'window.__dynamic_base__',
transformIndexHtml: false
})