@gudhub/core 1.2.4-beta.1 → 1.2.4-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,149 @@
1
+ import { fileURLToPath } from 'url';
2
+ import path from 'path';
3
+
4
+
5
+ // import packageJson from './package.json';
6
+
7
+
8
+ // const appRequestWorkerURI = `https://unpkg.com/@gudhub/core@${packageJson.version}/umd/appRequestWorker.js`;
9
+
10
+
11
+ // Convert import.meta.url to a file path
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+
15
+ // import webpack, { library } from 'webpack';
16
+
17
+ export default {
18
+ // entry: './indexUMD.js', // Entry point of your library
19
+ entry: {
20
+ // main: './path/to/my/entry/file.js',
21
+ // appRequestWorker: './GUDHUB/DataService/IndexedDB/appRequestWorker.js',
22
+ main: {
23
+ import: './indexUMD.js',
24
+ filename: 'library.min.js',
25
+ // library: 'GudHubLibrary', // Global variable name
26
+ // type: 'umd,',
27
+
28
+ library: {
29
+ type: 'umd',
30
+ name: 'GudHubLibrary',
31
+ }
32
+ },
33
+ appRequestWorker: {
34
+ import: './GUDHUB/DataService/IndexedDB/appRequestWorker.js',
35
+ filename: 'appRequestWorker.js',
36
+ },
37
+ },
38
+ output: {
39
+ path: path.resolve(__dirname, './umd'),
40
+ // filename: 'library.min.js', // Output filename
41
+ // library: 'GudHubLibrary', // Global variable name
42
+ // libraryTarget: 'umd', // Universal Module Definition
43
+ globalObject: 'this' // Ensures compatibility in various environments
44
+ },
45
+ devtool: 'eval', // Enable source maps
46
+ module: {
47
+ rules: [
48
+ {
49
+ test: /\.js$/,
50
+ exclude: /node_modules/,
51
+ use: {
52
+ loader: 'babel-loader',
53
+ options: {
54
+ presets: ['@babel/preset-env']
55
+ }
56
+ }
57
+ },
58
+ // {
59
+ // test: /appRequestWorker.js\.js$/,
60
+ // use: {
61
+ // loader: 'worker-loader',
62
+ // options: {
63
+ // inline: "no-fallback",
64
+ // },
65
+ // },
66
+ // },
67
+ ]
68
+ },
69
+ // experiments: {
70
+ // topLevelAwait: true,
71
+ // },
72
+ // plugins: [
73
+ // new webpack.optimize.LimitChunkCountPlugin({
74
+ // maxChunks: 1,
75
+ // }),
76
+ // ],
77
+ // optimization: {
78
+ // concatenateModules: true, // Ensure modules are concatenated
79
+ // // minimize: true, // Minimize the output bundle
80
+ // },
81
+
82
+ // optimization: {
83
+ // minimize: true, // Minimize the output bundle
84
+ // splitChunks: {
85
+ // chunks: 'all',
86
+ // minSize: 0,
87
+ // cacheGroups: {
88
+ // defaultVendors: {
89
+ // test: /[\\/]node_modules[\\/]/,
90
+ // priority: -10,
91
+ // reuseExistingChunk: true,
92
+ // },
93
+ // default: {
94
+ // minChunks: 2,
95
+ // priority: -20,
96
+ // reuseExistingChunk: true,
97
+ // },
98
+ // },
99
+ // },
100
+ // },
101
+ externals: [], // List any dependencies you want to exclude from the bundle
102
+ mode: 'production', // Use 'development' for development builds
103
+ };
104
+
105
+
106
+
107
+ //TODO worker url refactoring, currently url is like node_modules/....
108
+
109
+
110
+
111
+
112
+ // const path = require('path');
113
+
114
+ // console.log(process.env.IS_LOCAL_EDITOR_PACKAGE);
115
+
116
+ // const WEBPACK_DEFINE_PLUGIN_FALSE = 'false';
117
+ // const WEBPACK_DEFINE_PLUGIN_TRUE = 'true';
118
+
119
+ // module.exports.globals = {
120
+ // WEBPACK_DEFINE_PLUGIN_FALSE: JSON.stringify(WEBPACK_DEFINE_PLUGIN_FALSE),
121
+ // WEBPACK_DEFINE_PLUGIN_TRUE: JSON.stringify(WEBPACK_DEFINE_PLUGIN_TRUE),
122
+
123
+ // GUDHUB_SERVER_API_HOST: JSON.stringify(process.env.GUDHUB_SERVER_API_HOST),
124
+ // GUDHUB_SERVER_API_PATH: JSON.stringify(process.env.GUDHUB_SERVER_API_PATH),
125
+ // GUDHUB_SERVER_API_SCHEME: JSON.stringify(process.env.GUDHUB_SERVER_API_SCHEME),
126
+ // GUDHUB_NODE_SERVICES_HOST: JSON.stringify(process.env.GUDHUB_NODE_SERVICES_HOST),
127
+ // GUDHUB_NODE_SERVICES_API_PATH: JSON.stringify(process.env.GUDHUB_NODE_SERVICES_API_PATH),
128
+ // GUDHUB_NODE_SERVICES_SCHEME: JSON.stringify(process.env.GUDHUB_NODE_SERVICES_SCHEME),
129
+ // GUDHUB_FILE_SERVER_HOST: JSON.stringify(process.env.GUDHUB_FILE_SERVER_HOST),
130
+ // GUDHUB_FILE_SERVER_PORT: JSON.stringify(process.env.GUDHUB_FILE_SERVER_PORT),
131
+ // GUDHUB_FILE_SERVER_SCHEME: JSON.stringify(process.env.GUDHUB_FILE_SERVER_SCHEME),
132
+ // GUDHUB_SETTINGS_DEVELOPMENT_MODE: process.env.GUDHUB_SETTINGS_DEVELOPMENT_MODE,
133
+ // GUDHUB_SETTINGS_SHOW_CONTEXT_MENU: process.env.GUDHUB_SETTINGS_SHOW_CONTEXT_MENU,
134
+ // GUDHUB_VERSION: JSON.stringify(process.env.GUDHUB_VERSION || ''),
135
+ // SENTRY_DSN: JSON.stringify(process.env.SENTRY_DSN || ''),
136
+ // ENABLE_WEBSOCKETS: JSON.stringify(process.env.ENABLE_WEBSOCKETS || WEBPACK_DEFINE_PLUGIN_TRUE),
137
+ // IMAGE_MAKER_URL: JSON.stringify(process.env.IMAGE_MAKER_URL)
138
+ // };
139
+
140
+ // module.exports.resolveModuleList = [
141
+ // path.resolve(__dirname, './libs'),//TODO try to remove, awful directory in project
142
+ // path.resolve(__dirname, './override_npm'),
143
+ // path.resolve('./node_modules'),
144
+ // ];
145
+
146
+ // module.exports.resolveAlias = {
147
+ // '@gudhub/cad-editor': process.env.USE_LOCAL_EDITOR_PACKAGE ? path.resolve(__dirname, './override_npm/cad-editor/src/app') : '@gudhub/cad-editor',
148
+ // '@gudhub/core': process.env.USE_LOCAL_GUDHUB_PACKAGE ? path.resolve(__dirname, './override_npm/gudhub/index') : '@gudhub/core',
149
+ // };