mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Add minified build config, minify example bundle
This commit is contained in:
@@ -2,15 +2,21 @@ const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: './examples/browser.js',
|
||||
entry: './examples/browser/browser.js',
|
||||
output: {
|
||||
filename: './examples/bundle.js'
|
||||
filename: './examples/browser/bundle.js'
|
||||
},
|
||||
node: {
|
||||
console: false,
|
||||
process: 'mock',
|
||||
Buffer: 'buffer'
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
mangle: false,
|
||||
compress: { warnings: false }
|
||||
})
|
||||
],
|
||||
resolveLoader: {
|
||||
root: path.join(__dirname, 'node_modules')
|
||||
},
|
||||
@@ -26,7 +32,8 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
loaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /node_modules/,
|
||||
loader: 'babel',
|
||||
@@ -34,18 +41,21 @@ module.exports = {
|
||||
presets: require.resolve('babel-preset-es2015'),
|
||||
plugins: require.resolve('babel-plugin-transform-runtime')
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: /node_modules\/(hoek|qs|wreck|boom)/,
|
||||
include: /node_modules\/(hoek|qs|wreck|boom|ipfs-.+|orbit-db-.+|logplease|crdts)/,
|
||||
loader: 'babel',
|
||||
query: {
|
||||
presets: require.resolve('babel-preset-es2015'),
|
||||
plugins: require.resolve('babel-plugin-transform-runtime')
|
||||
}
|
||||
}, {
|
||||
},
|
||||
{
|
||||
test: /\.json$/,
|
||||
loader: 'json'
|
||||
}]
|
||||
}
|
||||
]
|
||||
},
|
||||
externals: {
|
||||
net: '{}',
|
||||
|
||||
Reference in New Issue
Block a user