diff --git a/packages/compiler-sfc/README.md b/packages/compiler-sfc/README.md index 4fc4ffa10..cc7b6cc05 100644 --- a/packages/compiler-sfc/README.md +++ b/packages/compiler-sfc/README.md @@ -2,14 +2,18 @@ > Lower level utilities for compiling Vue single file components -This package contains lower level utilities that you can use if you are writing a plugin / transform for a bundler or module system that compiles Vue single file components into JavaScript. It is used in [vue-loader](https://github.com/vuejs/vue-loader). +This package contains lower level utilities that you can use if you are writing a plugin / transform for a bundler or module system that compiles Vue single file components into JavaScript. It is used in [vue-loader](https://github.com/vuejs/vue-loader), [rollup-plugin-vue](https://github.com/vuejs/rollup-plugin-vue) and [vite](https://github.com/vitejs/vite). -The API surface is intentionally minimal - the goal is to reuse as much as possible while being as flexible as possible. +The API is intentionally low-level, because different toolings have different constraints on how much context is shared between the transformation of each block in an SFC. For example, the template sub-loader in `vue-loader` may not have access to the full SFC and its descriptor. -## Browser Build Usage +## Browser Build Notes -This package relies on `postcss`, `postcss-selector-parser` and `postcss-modules` +The browser build relies on a browser-bundled build of `postcss` to be available under the global `postcss` (since it can't be properly bundled by Rollup). -## API +## Usage Example -TODO +```js +// TODO +``` + +For detailed APIs, check out the source type definitions. diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index f041dde1e..47fff1dcf 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -11,8 +11,7 @@ "name": "VueCompilerSFC", "formats": [ "cjs", - "global", - "esm-browser" + "global" ], "prod": false, "enableNonBrowserBranches": true