@felloh-org/lambda-wrapper 1.11.102 → 1.11.104

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/webpack.config.js CHANGED
@@ -1,14 +1,23 @@
1
1
  const path = require('path');
2
- const nodeExternals = require('webpack-node-externals');
3
2
  const TerserPlugin = require("terser-webpack-plugin");
3
+ const WebpackAssetsManifest = require("webpack-assets-manifest");
4
+ const nodeExternals = require('webpack-node-externals');
5
+ const Dotenv = require('dotenv-webpack');
6
+ const CircularDependencyPlugin = require('circular-dependency-plugin')
4
7
 
5
8
  module.exports = {
6
9
  mode: 'production',
7
10
  entry: './src/index.js',
11
+ devtool: 'source-map',
8
12
  target: 'node',
9
- externals: [
10
- nodeExternals({
11
- modulesFromFile: true,
13
+ externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc.
14
+ externals: [nodeExternals()], // in order to ignore all modules in node_modules folder
15
+ plugins: [
16
+ new WebpackAssetsManifest(),
17
+ new Dotenv(),
18
+ new CircularDependencyPlugin({
19
+ // add errors to webpack instead of warnings
20
+ failOnError: false,
12
21
  }),
13
22
  ],
14
23
  output: {
@@ -21,14 +30,22 @@ module.exports = {
21
30
  },
22
31
  optimization: {
23
32
  minimize: true,
24
- minimizer: [new TerserPlugin()],
33
+ minimizer: [new TerserPlugin(
34
+ { terserOptions: { keep_classnames: true, keep_fnames: true } },
35
+ )],
36
+ moduleIds: 'named',
25
37
  },
26
38
  module: {
27
39
  rules: [
28
40
  {
29
41
  test: /\.js?$/,
30
42
  exclude: /(node_modules)/,
31
- use: 'babel-loader',
43
+ use: {
44
+ loader: 'babel-loader',
45
+ options: {
46
+ presets: ['@babel/preset-env'],
47
+ },
48
+ },
32
49
  },
33
50
  ],
34
51
  },