ice/packages/plugin-css-assets-local/README.md

50 lines
798 B
Markdown
Raw Normal View History

# @ice/plugin-css-assets-local
A plugin for localize css assets resource.
## Install
```bash
npm i -D @ice/plugin-css-assets-local
```
## Usage
Add plugin to your `ice.config.mts`:
```ts
// ice.config.mts
import { defineConfig } from '@ice/app';
import cssAssetsLocal from '@ice/plugin-css-assets-local';
export default defineConfig({
plugins: [
cssAssetsLocal(),
],
});
```
After running `npm run build`, you can see the assets resource will be downloaded to the local disk.
## Options
### `outputPath`
The assets resource output path.
- Type: `string`
- Default: `assets`
### `relativeCssPath`
The asset paths relative to the css file path.
- Type: `string`
- Default: `../`
### `enableInDev`
Whether enable the plugin in dev or not.
- Type: `boolean`
- Default: `false`