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"> <meta charset="utf-8">
</head> </head>
<body> <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/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" src="../node_modules/ipfs-api/dist/index.min.js" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
const logger = Logger.create("orbit-db example", { color: Logger.Colors.Green, showTimestamp: false, showLevel: false }); 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 username = 'user1';
const password = ''; const password = '';
const channel = 'browsertest1.dist'; const channel = 'browsertest2.dist';
const key = 'greeting'; const key = 'greeting';
const value = 'Hello world'; 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 webpack = require('webpack');
const path = require('path');
module.exports = { module.exports = {
entry: './src/OrbitDB.js', entry: './src/OrbitDB.js',
output: { output: {
libraryTarget: 'var', libraryTarget: 'var',
library: 'OrbitDB', library: 'OrbitDB',
filename: './dist/orbitdb.min.js' filename: './dist/orbitdb.js'
}, },
node: { node: {
console: false, console: false,
@ -18,9 +19,12 @@ module.exports = {
// compress: { warnings: false } // compress: { warnings: false }
// }) // })
// ], // ],
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
resolve: { resolve: {
modulesDirectories: [ modulesDirectories: [
'node_modules' path.join(__dirname, 'node_modules')
], ],
alias: { alias: {
fs: require.resolve('./node_modules/logplease/src/fs-mock'), fs: require.resolve('./node_modules/logplease/src/fs-mock'),
@ -35,16 +39,16 @@ module.exports = {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel', loader: 'babel',
query: { query: {
presets: ['es2015'], presets: require.resolve('babel-preset-es2015'),
plugins: ['transform-runtime'] plugins: require.resolve('babel-plugin-transform-runtime')
} }
}, { }, {
test: /\.js$/, test: /\.js$/,
include: /node_modules\/(hoek|qs|wreck|boom)/, include: /node_modules\/(hoek|qs|wreck|boom)/,
loader: 'babel', loader: 'babel',
query: { query: {
presets: ['es2015'], presets: require.resolve('babel-preset-es2015'),
plugins: ['transform-runtime'] plugins: require.resolve('babel-plugin-transform-runtime')
} }
}, { }, {
test: /\.json$/, test: /\.json$/,

View File

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