Fix webpack builds and update browser example. Rename browser dist file to dist/orbitdb.js (not minimized)

This commit is contained in:
haad 2016-05-11 12:25:28 +02:00
parent a0c6ec24e2
commit 5889a4ef50
5 changed files with 8626 additions and 11313 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,15 +3,15 @@
<meta charset="utf-8">
</head>
<body>
<script type="text/javascript" src="../dist/orbitdb.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../dist/orbitdb.js" charset="utf-8"></script>
<script type="text/javascript" src="../node_modules/logplease/dist/logplease.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../node_modules/ipfs-api/dist/index.min.js" charset="utf-8"></script>
<script type="text/javascript">
const logger = Logger.create("orbit-db example", { color: Logger.Colors.Green, showTimestamp: false, showLevel: false });
const network = 'QmYPobvobKsyoCKTw476yTui611XABf927KxUPCf4gRLRr'; // 'localhost:3333'
const network = 'QmZjhqUtFK3aWbUfjYEsgS8CMK8fZrQXqUcqW5Q32LznMk'; // 'localhost:3333'
const username = 'user1';
const password = '';
const channel = 'browsertest1.dist';
const channel = 'browsertest2.dist';
const key = 'greeting';
const value = 'Hello world';

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './src/OrbitDB.js',
output: {
libraryTarget: 'var',
library: 'OrbitDB',
filename: './dist/orbitdb.min.js'
filename: './dist/orbitdb.js'
},
node: {
console: false,
@ -18,9 +19,12 @@ module.exports = {
// compress: { warnings: false }
// })
// ],
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
resolve: {
modulesDirectories: [
'node_modules'
path.join(__dirname, 'node_modules')
],
alias: {
fs: require.resolve('./node_modules/logplease/src/fs-mock'),
@ -35,16 +39,16 @@ module.exports = {
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
presets: require.resolve('babel-preset-es2015'),
plugins: require.resolve('babel-plugin-transform-runtime')
}
}, {
test: /\.js$/,
include: /node_modules\/(hoek|qs|wreck|boom)/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
presets: require.resolve('babel-preset-es2015'),
plugins: require.resolve('babel-plugin-transform-runtime')
}
}, {
test: /\.json$/,

View File

@ -1,4 +1,5 @@
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './examples/browser.js',
@ -10,9 +11,12 @@ module.exports = {
process: 'mock',
Buffer: 'buffer'
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
resolve: {
modulesDirectories: [
'node_modules'
path.join(__dirname, 'node_modules')
],
alias: {
fs: require.resolve('./node_modules/logplease/src/fs-mock'),
@ -27,16 +31,16 @@ module.exports = {
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
presets: require.resolve('babel-preset-es2015'),
plugins: require.resolve('babel-plugin-transform-runtime')
}
}, {
test: /\.js$/,
include: /node_modules\/(hoek|qs|wreck|boom)/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
presets: require.resolve('babel-preset-es2015'),
plugins: require.resolve('babel-plugin-transform-runtime')
}
}, {
test: /\.json$/,