2016-10-03 17:25:51 +02:00
|
|
|
const webpack = require('webpack')
|
|
|
|
const path = require('path')
|
2016-04-15 11:39:46 +02:00
|
|
|
|
|
|
|
module.exports = {
|
2016-04-27 09:12:40 +02:00
|
|
|
entry: './src/OrbitDB.js',
|
2016-04-15 11:39:46 +02:00
|
|
|
output: {
|
|
|
|
libraryTarget: 'var',
|
|
|
|
library: 'OrbitDB',
|
2016-05-11 12:25:28 +02:00
|
|
|
filename: './dist/orbitdb.js'
|
2016-04-15 11:39:46 +02:00
|
|
|
},
|
2016-10-03 17:25:51 +02:00
|
|
|
devtool: 'sourcemap',
|
2016-11-25 17:28:42 +01:00
|
|
|
stats: {
|
|
|
|
colors: true,
|
|
|
|
cached: false
|
|
|
|
},
|
2016-04-15 11:39:46 +02:00
|
|
|
node: {
|
|
|
|
console: false,
|
|
|
|
process: 'mock',
|
2016-10-03 17:25:51 +02:00
|
|
|
Buffer: true
|
2016-05-11 12:25:28 +02:00
|
|
|
},
|
2016-10-05 10:57:49 +02:00
|
|
|
plugins: [
|
|
|
|
],
|
2016-04-15 11:39:46 +02:00
|
|
|
resolve: {
|
2016-10-03 17:25:51 +02:00
|
|
|
modules: [
|
2016-10-05 10:57:49 +02:00
|
|
|
path.join(__dirname, '../node_modules')
|
2016-04-15 11:39:46 +02:00
|
|
|
],
|
|
|
|
alias: {
|
|
|
|
http: 'stream-http',
|
|
|
|
https: 'https-browserify',
|
|
|
|
Buffer: 'buffer'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
module: {
|
2016-07-31 11:10:15 +02:00
|
|
|
loaders: [
|
2016-10-03 17:25:51 +02:00
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
exclude: /node_modules/,
|
2016-11-21 11:43:09 +01:00
|
|
|
loader: 'babel-loader',
|
2016-10-03 17:25:51 +02:00
|
|
|
query: {
|
|
|
|
presets: require.resolve('babel-preset-es2015'),
|
|
|
|
plugins: require.resolve('babel-plugin-transform-runtime')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
include: /node_modules\/(hoek|qs|wreck|boom|ipfs-.+|orbit-db.+|logplease|crdts|promisify-es6)/,
|
2016-11-21 11:43:09 +01:00
|
|
|
loader: 'babel-loader',
|
2016-10-03 17:25:51 +02:00
|
|
|
query: {
|
|
|
|
presets: require.resolve('babel-preset-es2015'),
|
|
|
|
plugins: require.resolve('babel-plugin-transform-runtime')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.json$/,
|
2016-11-21 11:43:09 +01:00
|
|
|
loader: 'json-loader'
|
2016-04-15 11:39:46 +02:00
|
|
|
}
|
2016-10-03 17:25:51 +02:00
|
|
|
]
|
2016-04-15 11:39:46 +02:00
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
net: '{}',
|
|
|
|
tls: '{}',
|
|
|
|
'require-dir': '{}'
|
|
|
|
}
|
2016-10-03 17:25:51 +02:00
|
|
|
}
|