-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.base.js
More file actions
52 lines (46 loc) · 1.14 KB
/
webpack.base.js
File metadata and controls
52 lines (46 loc) · 1.14 KB
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
const path = require('path');
const fs = require('fs');
const { dependencies } = require('./package.json');
const webpack = require('webpack');
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs2 ' + mod;
});
module.exports = {
context: __dirname,
entry: ['babel-polyfill', path.join(process.cwd(), 'javascripts', 'index.js')],
output: {
path: path.resolve(__dirname || process.cwd(), 'public'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loaders: [
'style-loader',
'css-loader?importLoaders=1&localIdentName=[path]_[name]_[local]__[hash:base64:5]',
'postcss-loader'
]
},
{
test: /\.(jpg|png|woff|woff2|eot|otf|ttf|svg)$/,
loader: 'url-loader?limit=100000'
}
]
},
externals: nodeModules,
target: 'electron'/*,
plugins: [
new webpack.NoEmitOnErrorsPlugin()
]*/
}