Skip to content

Commit

Permalink
refactor(vue): detect when resolving absolute urls is necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Feb 28, 2022
1 parent a5d9f4a commit f017465
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
7 changes: 0 additions & 7 deletions docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,6 @@ export default defineConfig(async ({ command, mode }) => {
- **Related:** [esbuild#preserve-symlinks](https://esbuild.github.io/api/#preserve-symlinks), [webpack#resolve.symlinks
](https://webpack.js.org/configuration/resolve/#resolvesymlinks)

### resolve.absoluteUrls

- **Type:** `boolean`
- **Default:** `true`

This setting determines whether Vite should force absolute asset URLs into import requests to make them go through the asset plugin.

### css.modules

- **Type:**
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
root: config.root,
sourceMap: config.command === 'build' ? !!config.build.sourcemap : true,
isProduction: config.isProduction,
resolveAbsoluteUrls: config.resolve?.absoluteUrls ?? true
resolveAbsoluteUrls: !config.server.origin
}
},

Expand Down
1 change: 0 additions & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export interface ResolveOptions {
extensions?: string[]
dedupe?: string[]
preserveSymlinks?: boolean
absoluteUrls?: boolean
}

export interface InternalResolveOptions extends ResolveOptions {
Expand Down

0 comments on commit f017465

Please sign in to comment.