1.2.0 • Published 2 months ago
@palette.dev/plugin-vite v1.2.0
@palette.dev/plugin-vite
Installation
This package requires vite@3.x.x
.
npm install @palette.dev/plugin-vite --save-dev
Usage
1. Update vite config
// vite.config.ts
import palette from "@palette.dev/plugin-vite";
export default defineConfig({
plugins: [
palette({
// Get your asset key at https://palette.dev/[your-username]/[your-project]/settings.
// See https://docs.palette.dev#assets
key: "YOUR_ASSET_KEY",
outputPath: "dist/assets",
}),
],
build: {
// Enable source maps
sourcemap: true,
// Rewrite source maps, relative to project root
rollupOptions: {
output: {
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) =>
path.relative(
process.cwd(),
path.resolve(path.dirname(sourcemapPath), relativeSourcePath)
),
},
},
},
});
2. Add entrypoint
Import virtual:@palette.dev/plugin-vite/init
in your app's entrypoint (e.g. main.js) before the palette import:
// main.js
import "virtual:@palette.dev/plugin-vite/init";
import { init } from "@palette.dev/...";
init({
// ...
});
// ...other imports
1.2.1-feat-react-native.1
2 months ago
1.2.0
7 months ago
1.1.2
10 months ago
1.1.3-feat-react-paint-vite-plugin.1
8 months ago
1.1.3-feat-react-paint-vite-plugin.4
7 months ago
1.1.3-feat-react-paint-vite-plugin.3
7 months ago
1.1.3-feat-react-paint-vite-plugin.2
7 months ago
1.1.2-fix-tools-cli-outputpath-default.1
10 months ago
1.1.1
1 year ago
1.1.0
1 year ago
1.2.0-fix-cli-improvements.1
1 year ago
1.1.0-feat-cli-setup.1
1 year ago
1.1.1-fix-cli-improvements.1
1 year ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.10-fix-vite-plugin.1
2 years ago
1.0.10-fix-vite-plugin.2
2 years ago
1.0.10
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.0.0
2 years ago