A vite plugin that will mark prefixed modules as external and will transform the path in production into a path relative to the root.
pnpm i "@open-xchange/vite-plugin-ox-externals"
// in the vite.config.js
import vitePluginOxExternals from '@open-xchange/vite-plugin-ox-externals'
return {
plugins: [vitePluginOxExternals()]
}
You can provide the following options to the plugin:
Name | Type | Default | Description |
---|---|---|---|
prefix |
string |
'$' |
The prefix to use for external modules. Will always be followed by a / if you specify the path. |
// import the core settings module
import { Settings } from '$/io.ox/core/settings'
pnpm test