-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathwebpack.config.js
More file actions
43 lines (42 loc) · 929 Bytes
/
Copy pathwebpack.config.js
File metadata and controls
43 lines (42 loc) · 929 Bytes
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
const webpack = require('webpack')
module.exports = env => ({
mode: env.production ? 'production' : 'development',
entry: "./src/index.ts",
output: {
libraryTarget: "umd",
library: "RLogin",
umdNamedDefine: true,
globalObject: "this",
filename: "index.js"
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
fallback: {
"assert": require.resolve("assert/"),
"stream": require.resolve("stream-browserify"),
}
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
})
],
devtool: "source-map",
module: {
rules: [
{ test: /\.tsx?$/, loader: "ts-loader" },
{
test: /\.(png|svg|jpg|gif)$/,
use: [
{
loader: "url-loader",
options: {
limit: 65535,
name: "static/media/[name].[hash:8].[ext]"
}
}
]
}
]
}
});