orbit-db/conf/webpack.config.js

65 lines
1.3 KiB
JavaScript
Raw Normal View History

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',
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
},
plugins: [
],
2016-04-15 11:39:46 +02:00
resolve: {
2016-10-03 17:25:51 +02:00
modules: [
path.join(__dirname, '../node_modules')
2016-04-15 11:39:46 +02:00
],
alias: {
http: 'stream-http',
https: 'https-browserify',
Buffer: 'buffer'
}
},
module: {
loaders: [
2016-10-03 17:25:51 +02:00
{
test: /\.js$/,
exclude: /node_modules/,
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)/,
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$/,
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
}