orbit-db/conf/webpack.example.config.js

61 lines
1.2 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 = {
entry: './examples/browser/index.js',
2016-04-15 11:39:46 +02:00
output: {
filename: './examples/browser/bundle.js'
2016-04-15 11:39:46 +02:00
},
2016-10-04 09:48:01 +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-04-15 11:39:46 +02:00
},
plugins: [
2016-11-25 16:02:49 +01:00
new webpack.optimize.UglifyJsPlugin({
mangle: false,
compress: { warnings: false }
})
],
2016-04-15 11:39:46 +02:00
resolve: {
2016-10-03 17:25:51 +02:00
modules: [
2016-11-25 16:02:49 +01:00
'node_modules',
path.resolve(__dirname, '../node_modules')
],
alias: {
// These are needed because node-libs-browser depends on outdated
// versions
//
// Can be dropped once https://github.com/devongovett/browserify-zlib/pull/18
// is shipped
zlib: 'browserify-zlib-next',
2016-11-25 16:02:49 +01:00
// Can be dropped once https://github.com/webpack/node-libs-browser/pull/41
// is shipped
http: 'stream-http'
}
},
resolveLoader: {
modules: [
'node_modules',
path.resolve(__dirname, '../node_modules')
],
moduleExtensions: ['-loader']
2016-04-15 11:39:46 +02:00
},
module: {
2016-11-25 16:02:49 +01:00
rules: [{
test: /\.json$/,
loader: 'json-loader'
}]
},
node: {
Buffer: true
2016-04-15 11:39:46 +02:00
},
2016-11-25 16:02:49 +01:00
plugins: [],
target: 'web'
2016-10-03 17:25:51 +02:00
}