jlongster / absurd-sql

sqlite3 in ur indexeddb (hopefully a better backend soon)
MIT License
4.15k stars 101 forks source link

Background Script in Chrome Extension #28

Closed Debdut closed 2 years ago

Debdut commented 2 years ago

I can't get it working with the background script in Chrome Extension. Should it work?

Debdut commented 2 years ago

I have prepared a chrome extension with absurd sql in the background -- https://github.com/Debdut/absurd-sql-chrome-extension

It doesn't work. Please make it work 🙏

Debdut commented 2 years ago

All I needed to do was copy sql-wasm.wasm file to chrome extension folder.

You can add this to Webpack in the following way:

plugins: [
    new CopyPlugin({
      patterns: [{
          from: join(Root, 'node_modules', '@jlongster', 'sql.js', 'dist', 'sql-wasm.wasm'),
          to: '',
        }]
    })
]

Also this repo https://github.com/Debdut/absurd-sql-chrome-extension has everything set up for you if you want to build chrome extensions with absurd sql!