forked from ProbableTrain/MapGenerator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
72 lines (67 loc) · 2.05 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const path = require('path');
const { ModuleFederationPlugin } = require('webpack').container;
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: [
'./src/main.ts',
'./src/index.ts',
'./src/js/deepqlearn.js','./src/js/convnet.js','./src/js/vis.js',
'./digibyte.js',
'./src/ts/model_generator.ts',
'./src/ts/util.ts',
'./src/ts/vector.ts',
'./src/ts/impl/basis_field.ts','./src/ts/impl/graph.ts','./src/ts/impl/grid_storage.ts','./src/ts/impl/integrator.ts',
'./src/ts/impl/polygon_finder.ts','./src/ts/impl/polygon_util.ts','./src/ts/impl/streamlines.ts','./src/ts/impl/tensor.ts',
'./src/ts/impl/tensor_field.ts',
'./src/ts/impl/water_generator.ts',
'./src/ts/ui/buildings.ts',
'./src/ts/ui/canvas_wrapper.ts',
'./src/ts/ui/domain_controller.ts',
'./src/ts/ui/drag_controller.ts',
'./src/ts/ui/main_gui.ts',
'./src/ts/ui/road_gui.ts',
'./src/ts/ui/style.ts',
'./src/ts/ui/tensor_field_gui.ts',
'./src/ts/ui/water_gui.ts',
'./dist/bundle.js',
'./geodesic_dome/geodesicDome.ts'
],
mode: 'development',
plugins: [
new ModuleFederationPlugin({
name: 'fabcity',
filename: 'remoteEntry.js',
exposes: {'./Module': './src/index',},
shared: {
'lodash': { singleton: true },
'jszip':{singleton: true, eager: true},
'cities.json':{singleton: true, eager: true},
'convnetjs': { singleton: true },
'@types/jsts': { singleton: true, eager: true },
'digibyte-js': { singleton: true },
'browserify': { singleton: true },
},
}),
],
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
//exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.ts', '.js' ,'.json','.d.ts','.dt.ts'],
byDependency: {
commonjs: { aliasFields: ['browser'] },
url: { preferRelative: true },
},
},
output: {
filename: 'web3.js',
path: path.resolve(__dirname, 'dist'),
},
};