44 lines
891 B
JavaScript
44 lines
891 B
JavaScript
'use strict'
|
|
|
|
const path = require('path')
|
|
const webpack = require('webpack')
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
|
|
const production = process.argv.indexOf('-p') !== -1
|
|
|
|
module.exports = {
|
|
devtool: 'source-map',
|
|
entry: {
|
|
'bundle': './src/index',
|
|
'fetcher': './src/fetcher'
|
|
},
|
|
output: {
|
|
path: path.join(__dirname, 'dist'),
|
|
filename: '[name].js',
|
|
sourceMapFilename: '[name].js.map',
|
|
publicPath: '/ipfs/'
|
|
},
|
|
plugins: production ? [
|
|
new UglifyJSPlugin({sourceMap: true})
|
|
] : [],
|
|
module: {
|
|
loaders: [
|
|
{
|
|
test: /\.js$/,
|
|
include: path.join(__dirname, 'src'),
|
|
exclude: [/fetcher/],
|
|
loader: 'babel-loader'
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
include: [/fetcher/],
|
|
loader: 'babel-loader'
|
|
}
|
|
]
|
|
},
|
|
node: {
|
|
fs: 'empty',
|
|
net: 'empty',
|
|
tls: 'empty'
|
|
}
|
|
}
|