Fix browser example
This commit is contained in:
parent
84e984a4cb
commit
1c1668c207
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,5 +7,6 @@ dump.rdb
|
||||
Vagrantfile
|
||||
orbit-db-cache.json
|
||||
examples/browser/bundle.js
|
||||
examples/browser/*.map
|
||||
dist/*.map
|
||||
dist/orbitdb.js
|
||||
|
@ -16,7 +16,7 @@ try {
|
||||
const log = orbit.eventlog(channel + ".log")
|
||||
const counter = orbit.counter(channel + ".count")
|
||||
|
||||
const creatures = ['👻', '🤖', '🐬', '🐞', '🐈']
|
||||
const creatures = ['👻', '🐙', '🐷', '🐬', '🐞', '🐈', '🙉', '🐸', '🐓']
|
||||
|
||||
let count = 1
|
||||
const query = () => {
|
||||
@ -38,18 +38,20 @@ try {
|
||||
const count = counter.value()
|
||||
|
||||
const output =
|
||||
`
|
||||
`<b>Key-Value Store</b>
|
||||
---------------------------------------------------
|
||||
Key | Value
|
||||
---------------------------------------------------
|
||||
${key} | ${result}
|
||||
---------------------------------------------------
|
||||
|
||||
<b>Eventlog</b>
|
||||
---------------------------------------------------
|
||||
Latest Visitors
|
||||
---------------------------------------------------
|
||||
${latest.reverse().map((e) => e.payload.value).join('\n')}
|
||||
${latest.reverse().map((e) => e.payload.value + " - " + new Date(e.payload.meta.ts).toISOString()).join('\n')}
|
||||
|
||||
<b>Counter</b>
|
||||
---------------------------------------------------
|
||||
Visitor Count: ${count}
|
||||
---------------------------------------------------
|
||||
|
@ -8,16 +8,17 @@ module.exports = {
|
||||
output: {
|
||||
filename: './examples/browser/bundle.js'
|
||||
},
|
||||
devtool: 'sourcemap',
|
||||
node: {
|
||||
console: false,
|
||||
process: 'mock',
|
||||
Buffer: true
|
||||
},
|
||||
plugins: [
|
||||
// new webpack.optimize.UglifyJsPlugin({
|
||||
// mangle: false,
|
||||
// compress: { warnings: false }
|
||||
// })
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
mangle: false,
|
||||
compress: { warnings: false }
|
||||
})
|
||||
],
|
||||
resolve: {
|
||||
modules: [
|
||||
@ -40,7 +41,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: /node_modules\/(hoek|qs|wreck|boom|log|orbit.+|logplease|crdts|promisify-es|whatwg-fetch|node-fetch|isomorphic-fetch|db\.js)/,
|
||||
include: /node_modules\/(hoek|qs|wreck|boom|ipfs.+|orbit.+|logplease|crdts|promisify-es|whatwg-fetch|node-fetch|isomorphic-fetch|db\.js)/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
presets: require.resolve('babel-preset-es2015'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user