Skip to content

Commit caed897

Browse files
committed
Add docs for customResolver usage
1 parent af0c14f commit caed897

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/docs/src/why.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ As we can't build all the output files we need in one go, we instead run Vite th
7676

7777
In `rollupOptions` we configure `external: ['vue']`. This tells rollup to keep any imports from the `vue` package as imports, rather than pulling all the code into the built library. For output formats that don't support `import` it will be rewritten accordingly, e.g. using `require()` for CommonJS. For global (IIFE) builds, there is the extra setting `globals: { vue: 'Vue' }`, which tells rollup to rewrite imports like `import { ref } from 'vue'` as `const { ref } = Vue`, or code that's equivalent.
7878

79+
For pages that use [`@` aliases for `src` paths](questions#configure-src-alias), a `customResolver` is needed in the playground and docs packages. These packages pull in the library source code directly, so they need to resolve an `@` within the library code differently from an `@` within their own code.
80+
7981
## `__DEV__` and `__TEST__`
8082

8183
The project supports 'global variables' for `__DEV__` and `__TEST__`. The `__TEST__` variable isn't included by default and requires the `--extended` flag to opt in.

0 commit comments

Comments
 (0)