0.1.2 • Published 11 months ago
@scrshot/bundler v0.1.2
Scrshot
Package containing bundlers plugin for Scrshot.
Installation
You can install them from npm package registry:
Using npm:
npm install @scrshot/bundler
Using yarn:
yarn add @scrshot/bundler
Using pnpm:
pnpm add @scrshot/bundler
Usage
You can use bundler plugin in most bundlers on the market and many frameworks.
Usage with frameworks:
Next
// next.config.js
const withScrshot = require('@scrshot/bundler/next')({ /* options */ });
module.exports = withScrshot({ /* next config */ })
Nuxt
// nuxt.config.js
export default {
buildModules: [
['@scrshot/bundler/nuxt', { /* options */ }],
],
}
Usage with bundlers:
Vite
// vite.config.ts
import Scrshot from '@scrshot/bundler/vite'
export default defineConfig({
plugins: [
Scrshot({ /* options */ }),
],
})
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('@scrshot/bundler/webpack')({ /* options */ })
]
}
Rollup
// rollup.config.js
import Scrshot from '@scrshot/bundler/rollup'
export default {
plugins: [
Scrshot({ /* options */ }),
],
}
Esbuild
// esbuild.config.js
import { build } from 'esbuild'
import Scrshot from '@scrshot/bundler/esbuild'
build({
plugins: [Scrshot({ /* options */ })],
})
Rspack
// rspack.config.js
module.exports = {
plugins: [require('@scrshot/bundler/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