-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
73 lines (70 loc) · 1.77 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const webpack = require('webpack')
const webpackTargetElectronRenderer = require('webpack-target-electron-renderer')
const path = require('path')
const config = {
entry: {
app: [
'webpack/hot/only-dev-server',
'./src/index.js'
]
},
externals: {
// Needed for js-ipfs-api
net: '{}',
fs: '{}',
tls: '{}',
console: '{}',
mkdirp: '{}',
'require-dir': '{}'
},
module: {
loaders: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules|vendor/,
loader: 'babel'
},
{
test: /\.json?$/,
loader: 'json-loader'
},
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader'},
{ test: /\.scss$/, loaders: ['style', 'css', 'sass']},
{ test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' },
{ test: /\.coffee$/, loader: "coffee-loader" },
{ test: /\.(coffee\.md|litcoffee)$/, loader: "coffee-loader?literate" }
],
postLoaders: [{
include: /ipfs/,
test: /\.js$/,
loader: 'transform?brfs'
}]
},
resolve: {
extensions: ['', '.js', '.jsx'],
modulesDirectories: [
'node_modules',
path.join(__dirname, 'node_modules')
],
alias: {
'node_modules': path.join(__dirname + '/node_modules'),
'fs': path.join(__dirname + '/node_modules', 'html5-fs')
}
},
output: {
path: __dirname + '/app/dist',
publicPath: '/',
filename: 'bundle.js'
},
devServer: {
contentBase: './app/dist'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.IgnorePlugin(new RegExp("^(ipc)$"))
]
}
// This causes error
//config.target = webpackTargetElectronRenderer(config)
module.exports = config