Socket
Socket
Sign inDemoInstall

an_vite-plugin-dynamic-base

Package Overview
Dependencies
26
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    an_vite-plugin-dynamic-base

Resolve all resource files dynamic publicPath, like Webpack's __webpack_public_path__


Version published
Maintainers
1
Created

Changelog

Source

1.0.1

2024-02-02

Feat
  • Add support for replacement in template literals. (#28 by @joarfish)

Readme

Source

vite-plugin-dynamic-base

Version Languages License Star Download

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

  • es
  • system

Compatible plugins

Usage

// vite.config.ts
import { dynamicBase } from 'vite-plugin-dynamic-base'

export default defineConfig({
  // base: "/",
  base: process.env.NODE_ENV === "production" ? "/__dynamic_base__/" : "/",
  plugins: [
    dynamicBase({ /* options */ }),
  ],
})

Configuration

The following show the default values of the configuration

dynamicBase({
  // dynamic public path var string, default window.__dynamic_base__
  publicPath: 'window.__dynamic_base__',
  // dynamic load resources on index.html, default false. maybe change default true
  transformIndexHtml:  false
})

Keywords

FAQs

Last updated on 31 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc