|
@@ -0,0 +1,46 @@
|
|
1
|
+const path = require('path');
|
|
2
|
+const webpack = require('webpack');
|
|
3
|
+const BomPlugin = require('webpack-utf8-bom');
|
|
4
|
+
|
|
5
|
+module.exports = {
|
|
6
|
+ mode: 'production',
|
|
7
|
+ target: "web",
|
|
8
|
+ entry: path.resolve(__dirname, 'src', 'main.ts'),
|
|
9
|
+ output: {
|
|
10
|
+ path: path.resolve(__dirname, 'lib', 'browser'),
|
|
11
|
+ filename: "rjsvm.browser.js",
|
|
12
|
+ libraryTarget: 'window'
|
|
13
|
+ },
|
|
14
|
+ resolve: {
|
|
15
|
+ extensions: [".ts", ".tsx", ".js"],
|
|
16
|
+ fallback: {
|
|
17
|
+ "zlib": require.resolve("browserify-zlib"),
|
|
18
|
+ "http": require.resolve("stream-http"),
|
|
19
|
+ "https": require.resolve("https-browserify"),
|
|
20
|
+ "stream": require.resolve("stream-browserify") ,
|
|
21
|
+ "buffer": require.resolve('buffer/'),
|
|
22
|
+ "Buffer": require.resolve('buffer/'),
|
|
23
|
+ "url": require.resolve('url/'),
|
|
24
|
+ "crypto": require.resolve('crypto-browserify'),
|
|
25
|
+ }
|
|
26
|
+ },
|
|
27
|
+ module: {
|
|
28
|
+ rules: [
|
|
29
|
+ { test: /\.ts?$/, loader: "ts-loader" }
|
|
30
|
+ ]
|
|
31
|
+ },
|
|
32
|
+ optimization: {
|
|
33
|
+ minimize: true,
|
|
34
|
+ },
|
|
35
|
+ plugins: [
|
|
36
|
+ new webpack.ProvidePlugin({
|
|
37
|
+ Buffer: ['buffer', 'Buffer'],
|
|
38
|
+ }),
|
|
39
|
+ new webpack.ProvidePlugin({
|
|
40
|
+ process: 'process/browser.js',
|
|
41
|
+ }),
|
|
42
|
+ new BomPlugin(true)
|
|
43
|
+ ],
|
|
44
|
+ externals: {
|
|
45
|
+ }
|
|
46
|
+}
|