-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
53 lines (46 loc) · 1.1 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
const PACKAGE = require('./package.json')
const webpack = require('webpack')
module.exports = {
target: "web",
mode: 'development', // production | development
devtool: 'source-map',
entry: [ "babel-polyfill", "./src/index.ts" ],
// Assign 'module.exports' to the variable defined by `output.library`
output: {
library: "HoloWebSDK",
libraryTarget: "umd",
publicPath: "/dist/",
},
resolve: {
extensions: [".ts", ".js"],
fallback: {
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
buffer: require.resolve("buffer/"),
},
},
module: {
rules: [
{
test: /\.tsx?$/, loader: "ts-loader"
},
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env','@babel/preset-typescript']
}
}
}
],
},
plugins: [
new webpack.DefinePlugin({
'process.env':{
'VERSION': `'${PACKAGE.version}'`,
},
}),
],
};