Fix browser example

This commit is contained in:
haad 2016-10-04 09:48:01 +02:00
parent 84e984a4cb
commit 1c1668c207
3 changed files with 13 additions and 9 deletions

1
.gitignore vendored
View File

@ -7,5 +7,6 @@ dump.rdb
Vagrantfile
orbit-db-cache.json
examples/browser/bundle.js
examples/browser/*.map
dist/*.map
dist/orbitdb.js

View File

@ -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 | 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}
---------------------------------------------------

View File

@ -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'),