first cut at embedding dendrite into riot as a service-worker

This commit is contained in:
Matthew Hodgson
2020-01-23 13:22:52 -07:00
parent 119802d00f
commit 80411d38f7
7 changed files with 617 additions and 1 deletions
+14 -1
View File
@@ -27,7 +27,12 @@ module.exports = (env, argv) => {
entry: {
"bundle": "./src/vector/index.js",
"indexeddb-worker": "./src/vector/indexeddb-worker.js",
"dendrite-sw": "./src/vector/dendrite-sw.js",
"mobileguide": "./src/vector/mobile_guide/index.js",
"sqlite_bridge": "./node_modules/go-sqlite3-js/js/bridge.js",
"go_http_bridge": "./node_modules/go-http-js-libp2p/js/bridge.js",
"sql_wasm": "./node_modules/go-sqlite3-js/node_modules/sql.js/dist/sql-wasm.wasm",
"dendrite_wasm": "./src/vector/dendrite.wasm",
// CSS themes
"theme-light": "./node_modules/matrix-react-sdk/res/themes/light/css/light.scss",
@@ -205,7 +210,9 @@ module.exports = (env, argv) => {
loader: "file-loader",
type: "javascript/auto", // https://github.com/webpack/webpack/issues/6725
options: {
name: '[name].[hash:7].[ext]',
// fixme - we should have a hash in this for cachebusting, but haven't figured
// out a way yet to pass the resulting path from webpack into dendrite-sw
name: '[name].[ext]',
outputPath: '.',
},
},
@@ -259,6 +266,10 @@ module.exports = (env, argv) => {
]
},
node: {
fs: 'empty' // needed for sql.js
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
@@ -308,6 +319,8 @@ module.exports = (env, argv) => {
// chunks even after the app is redeployed.
filename: "bundles/[hash]/[name].js",
chunkFilename: "bundles/[hash]/[name].js",
libraryTarget: "var",
library: "[name]",
},
// configuration for the webpack-dev-server