-
|
I'm trying to use PouchDB's memory adapter with Rollup. Here is an example script that does nothing but setup PouchDB with the memory adapter: import PouchDB from 'pouchdb-browser'
import MemoryAdapterPlugin from 'pouchdb-adapter-memory'
PouchDB.plugin(MemoryAdapterPlugin)Here is a Rollup config that will at least make a bundle with that script import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import polyfillNode from 'rollup-plugin-polyfill-node'
export default {
input: 'index.js',
output: {
format: 'iife',
name: 'app',
file: 'bundle.js'
},
plugins: [
commonjs({
requireReturnsDefault: "auto",
}),
polyfillNode(),
resolve({
preferBuiltins: true,
browser: true
}),
]
}When I attempt to load it in the browser it ends up getting error related to the Anybody using the memory adapter in a browser and able to successfully bundle it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Ended up finding out the answer. Rather than repeat it here I have it posted over on StackOverflow at: https://stackoverflow.com/questions/71886246/bundling-pouchdb-adapter-memory-with-rollup |
Beta Was this translation helpful? Give feedback.
Ended up finding out the answer. Rather than repeat it here I have it posted over on StackOverflow at:
https://stackoverflow.com/questions/71886246/bundling-pouchdb-adapter-memory-with-rollup