orbit-db/conf/webpack.config.js

49 lines
898 B
JavaScript
Raw Normal View History

'use strict'
2016-10-03 17:25:51 +02:00
const path = require('path')
const webpack = require('webpack')
const Uglify = require('uglifyjs-webpack-plugin')
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.min.js'
2016-11-25 17:28:42 +01:00
},
target: 'web',
devtool: 'none',
externals: {
fs: '{}',
mkdirp: '{}',
},
node: {
console: false,
Buffer: true
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}
}),
new Uglify(),
],
2016-04-15 11:39:46 +02:00
resolve: {
2016-10-03 17:25:51 +02:00
modules: [
'node_modules',
path.resolve(__dirname, '../node_modules')
],
alias: {
leveldown: 'level-js',
},
},
resolveLoader: {
modules: [
'node_modules',
path.resolve(__dirname, '../node_modules')
2016-04-15 11:39:46 +02:00
],
moduleExtensions: ['-loader']
2016-04-15 11:39:46 +02:00
},
2016-10-03 17:25:51 +02:00
}