-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (49 loc) · 1.7 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
const path = require('path');
const { defArg } = require('fmihel-server-lib');
const toRemotePath = defArg('path');
const toProduction = !toRemotePath && defArg('prod');
const SOURCE_PATH = './source/';
//const PUBLIC_PATH = toRemotePath?'C:/work/admin/node_modules/fmihel-redux-wrapper/dist/':'./dist/';
//const PUBLIC_PATH = toRemotePath?'C:\\work\\test2\\node_modules\\fmihel-redux-wrapper\\dist\\':'./dist/';
//const PUBLIC_PATH = toRemotePath?'E:/work/windeco/order-karniz/node_modules/fmihel-redux-wrapper/dist/':'./dist/';
const PUBLIC_PATH = toRemotePath?'D:\\work\\fmihel\\app-react\\node_modules\\fmihel-redux-wrapper\\dist\\':'./dist/';
module.exports = {
mode: toProduction ? 'production' : 'development',
devtool: toProduction ? false : 'inline-source-map',
entry: `${SOURCE_PATH}index.js`,
output: {
path: path.resolve(__dirname, PUBLIC_PATH),
filename: 'fmihel-redux-wrapper'+((toProduction||toRemotePath)?'.min':'')+'.js',
libraryTarget: 'umd',
globalObject: 'this',
library: 'fmihel-redux-wrapper',
},
externals: {
/*
lodash : {
commonjs: 'lodash',
commonjs2: 'lodash',
amd: 'lodash',
root: '_' // indicates global variable
},
*/
redux:'redux',
'redux-thunk':'redux-thunk'
// 'fmihel-lib': 'fmihel-lib',
// jquery: 'jquery',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
],
},
plugins: [
// new CleanWebpackPlugin(),
],
};