forked from OriginProtocol/origin-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
63 lines (59 loc) · 1.35 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
var nodeExternals = require('webpack-node-externals');
var serverConfig = {
entry: ["babel-polyfill", './src/index.js'],
output: {
filename: './index.js',
libraryTarget: 'commonjs2'
},
mode: 'development',
devtool: 'inline-source-map',
target: 'node',
externals: [nodeExternals()],
resolve: {
/**
* Overriding the default to allow jsx to be resolved automatically.
*/
extensions: ['.js', '.json', '.jsx'],
/**
* Access config from anywhere via `import settings from 'settings'``
*/
},
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['env', 'es2015', 'react'],
plugins: ['transform-class-properties']
}
}
]
}
}
var clientConfig = {
entry: ["babel-polyfill", './src/index.js'],
output: {
filename: './origin.js',
libraryTarget: 'var',
library: 'Origin'
},
mode: 'production',
devtool: false,
target: 'web',
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
query: {
presets: ['babel-preset-es2015'],
plugins: ['transform-class-properties']
}
}
]
}
}
module.exports = [ serverConfig, clientConfig ];