-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dist.config.js
90 lines (84 loc) · 2.36 KB
/
webpack.dist.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
var path = require('path');
var webpack = require('webpack');
const babelOptions = {
loader: 'babel-loader',
options: {
'sourceMaps': true,
'presets': [
['@babel/preset-env', {
'targets': {
'chrome': 68
}
}]
],
'ignore': [],
}
};
module.exports = function (env) {
return [{
target: "web",
entry: {
tynder: [
path.resolve(__dirname, 'src/index.ts')
],
"tynder-rt": [
path.resolve(__dirname, 'src/index-rt.ts')
]
},
node: {
// fs: false,
// console: false,
// process: false,
global: false,
__filename: false,
__dirname: false,
// Buffer: false,
// setImmediate: false,
},
output: {
library: 'tynder',
libraryTarget: 'umd',
globalObject: 'this',
filename: process.env.NODE_ENV === 'production' ? '[name].min.js' : '[name].js',
path: path.resolve(__dirname, 'dist'),
devtoolModuleFilenameTemplate: void 0
},
module: {
rules: [{
test: /\.tsx?$/,
use: [
babelOptions,
'ts-loader?' + JSON.stringify({
configFile: 'tsconfig.json'
}),
],
exclude: /node_modules[\/\\](?!tynder|liyad|fruitsconfits).*$/
}, {
test: /\.jsx?$/,
use: [
babelOptions,
],
exclude: /node_modules[\/\\](?!tynder|liyad|fruitsconfits).*$/
}, {
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
}, {
enforce: 'pre',
test: /\.[tj]sx?$/,
use: {
loader: 'source-map-loader',
options: {
}
},
exclude: /node_modules[\/\\](?!tynder|liyad|fruitsconfits).*$/
}]
},
plugins: [],
resolve: {
extensions: ['.tsx', '.ts', '.jsx', '.js']
},
devtool: 'source-map'
},
]}