orbit-db/conf/webpack.config.js

49 lines
898 B
JavaScript

'use strict'
const path = require('path')
const webpack = require('webpack')
const Uglify = require('uglifyjs-webpack-plugin')
module.exports = {
entry: './src/OrbitDB.js',
output: {
libraryTarget: 'var',
library: 'OrbitDB',
filename: './dist/orbitdb.min.js'
},
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(),
],
resolve: {
modules: [
'node_modules',
path.resolve(__dirname, '../node_modules')
],
alias: {
leveldown: 'level-js',
},
},
resolveLoader: {
modules: [
'node_modules',
path.resolve(__dirname, '../node_modules')
],
moduleExtensions: ['-loader']
},
}