0.2.0 • Published 2 years ago
@scrshot/build v0.2.0
Scrshot
Package containing build plugin for Scrshot.
Installation
You can install them from npm package registry:
Using npm:
npm install @scrshot/buildUsing yarn:
yarn add @scrshot/buildUsing pnpm:
pnpm add @scrshot/buildUsage
You can use build plugin in most bundlers on the market and many frameworks.
Usage with frameworks:
Next
// next.config.js
const withScrshot = require('@scrshot/build/next')({ /* options */ });
module.exports = withScrshot({ /* next config */ })Nuxt
// nuxt.config.js
export default {
buildModules: [
['@scrshot/build/nuxt', { /* options */ }],
],
}Usage with bundlers:
Vite
// vite.config.ts
import Scrshot from '@scrshot/build/vite'
export default defineConfig({
plugins: [
Scrshot({ /* options */ }),
],
})Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('@scrshot/build/webpack')({ /* options */ })
]
}Rollup
// rollup.config.js
import Scrshot from '@scrshot/build/rollup'
export default {
plugins: [
Scrshot({ /* options */ }),
],
}Esbuild
// esbuild.config.js
import { build } from 'esbuild'
import Scrshot from '@scrshot/build/esbuild'
build({
plugins: [Scrshot({ /* options */ })],
})Rspack
// rspack.config.js
module.exports = {
plugins: [require('@scrshot/build/rspack')({ /* options */ })],
};Options
strip
Default: true
Set to false to leave scrshot components in codebase
watch
Default: true
Set to false to tell bundler to not watch screenshot files.
Warning For now this is not supported in any bundler.
License
All rights reserved
0.2.0
2 years ago