1
0
mirror of https://github.com/fazo96/ipfs-boards synced 2025-01-10 12:24:20 +01:00
ipfs-boards/webpack.config.js

67 lines
1.6 KiB
JavaScript
Raw Normal View History

2015-11-20 14:20:06 +01:00
var path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// Most of the config was copied from js-ipfs-api's webpack configuration
module.exports = {
entry: './webapp/app.jsx',
debug: true,
output: {
path: path.join(__dirname,'webapp','dist'),
filename: 'app.js'
},
resolve: {
modulesDirectories: [
2015-11-20 20:21:54 +01:00
'node_modules', './webapp/', 'lib', './webapp/components/',
2015-11-20 14:20:06 +01:00
'node_modules/font-awesome/css', 'node_modules/font-awesome/fonts'
],
alias: {
http: 'stream-http',
https: 'https-browserify'
}
},
module: {
loaders: [
{ test: /\.(ttf|eot|svg|woff(2?))(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{ test: /\.css$/, loaders: ['style','css'] },
{ test: /\.json$/, loader: 'json' },
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015','react'],
plugins: ['transform-runtime']
}
},{
test: /\.js$/,
include: /node_modules\/(ipfs-api|hoek|qs|boom|wreck)/,
loader: 'babel',
query: {
presets: ['es2015'],
plugins: ['transform-runtime']
}
}
]
},
externals: {
fs: '{}'
},
plugins: [
new HtmlWebpackPlugin({
title: 'Boards',
template: 'webapp/template.html',
inject: 'body'
}),
// Optimization
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin()
]
}