onairos 0.1.141 → 0.1.142
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.
- package/package.json +1 -1
- package/webpack.config.js +4 -34
package/package.json
CHANGED
package/webpack.config.js
CHANGED
|
@@ -1,45 +1,14 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
4
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
5
2
|
|
|
6
3
|
module.exports = {
|
|
7
4
|
entry: path.resolve(__dirname, 'src', 'onairos.jsx'),
|
|
8
5
|
// './src/onairos.jsx', // Replace with your entry file
|
|
9
6
|
output: {
|
|
10
|
-
publicPath: '/', // or ''
|
|
11
7
|
path: path.resolve(__dirname, 'dist'),
|
|
12
8
|
filename: 'onairos.bundle.js',
|
|
13
9
|
libraryTarget: 'umd', // This makes your library compatible with different module systems
|
|
14
|
-
globalObject: 'this'
|
|
15
|
-
chunkFilename: '[name].js',
|
|
10
|
+
globalObject: 'this' // Ensures compatibility with both browser and Node environments
|
|
16
11
|
},
|
|
17
|
-
// plugins: [new BundleAnalyzerPlugin()],
|
|
18
|
-
// webpack.config.js
|
|
19
|
-
optimization: {
|
|
20
|
-
// splitChunks: {
|
|
21
|
-
// chunks: 'all',
|
|
22
|
-
// },
|
|
23
|
-
minimize: true,
|
|
24
|
-
minimizer: [
|
|
25
|
-
new TerserPlugin({
|
|
26
|
-
terserOptions: {
|
|
27
|
-
compress: {
|
|
28
|
-
// drop_console: true, // Removes console.* statements
|
|
29
|
-
// drop_debugger: true, // Removes debugger statements
|
|
30
|
-
dead_code: true, // Removes unreachable code
|
|
31
|
-
},
|
|
32
|
-
mangle: true, // Renames variables and functions to shorter names
|
|
33
|
-
output: {
|
|
34
|
-
comments: false, // Removes comments
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
extractComments: false, // Does not extract comments to a separate file
|
|
38
|
-
}),
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
// Make sure devtool is set to 'none' or false in production to disable source maps
|
|
42
|
-
devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
|
|
43
12
|
module: {
|
|
44
13
|
rules: [
|
|
45
14
|
{
|
|
@@ -61,5 +30,6 @@ module.exports = {
|
|
|
61
30
|
// "buffer": require.resolve("buffer/"),
|
|
62
31
|
// Add any other polyfills here
|
|
63
32
|
}
|
|
64
|
-
|
|
65
|
-
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
};
|