Webpack Plugin
Install
- npm
- pnpm
- yarn
npm install @palette.dev/webpack-plugin
pnpm install @palette.dev/webpack-plugin
yarn add @palette.dev/webpack-plugin
Usage
Get your asset key at https://palette.dev/[your-username]/[your-project]/settings
- Webpack
- Next.js
webpack.config.js
const PalettePlugin = require("@palette.dev/webpack-plugin");
module.exports = {
// ...
plugins: [
new PalettePlugin({
key: process.env.PALETTE_ASSET_KEY,
// Only upload source maps in CI
enableSourceMaps: "CI" in process.env,
}),
],
};
next.config.js
const { withPalette } = require("@palette.dev/webpack-plugin/next");
const withPalettePlugin = withPalette({
key: process.env.PALETTE_ASSET_KEY,
// Only upload source maps in CI vercel production deployments
enableSourceMaps: process.env.VERCEL_ENV === "production",
});
module.exports = withPalettePlugin({
// ...
});
API
Property | Description | Type | Default |
---|---|---|---|
key | Palette asset key | boolean | (required) |
version | Version of your app | boolean | git commit hash |
release | Mark version as release (see the release docs) | boolean | if the current git branch is main or master or false |
enableSourceMaps | Enable source map uploads | boolean | true |
include | Directories to search for source maps | string[] |