quidproquo-deploy-webpack 0.0.43 → 0.0.44
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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const path = require('path');
|
|
3
|
+
module.exports = function () {
|
|
4
|
+
const config = JSON.parse(process.env.QPQLoaderConfig);
|
|
5
|
+
const result = `module.exports = ${JSON.stringify(config.qpqConfig, null, 2)}`;
|
|
6
|
+
// console.log(result);
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const path = require('path');
|
|
3
3
|
module.exports = function (source) {
|
|
4
|
-
// console.log('Loader Running');
|
|
5
|
-
// console.log(process.env.QPQLoaderConfig);
|
|
6
|
-
// console.log('---');
|
|
7
4
|
const config = JSON.parse(process.env.QPQLoaderConfig);
|
|
8
5
|
const ifStatements = config.allSrcEntries.map((e) => {
|
|
9
6
|
return `if (moduleName === '${e}') {
|
package/lib/webpack.config.d.ts
CHANGED
|
@@ -3,11 +3,25 @@ export declare const getWebpackConfig: (qpqConfig: QPQConfig, buildPath: string,
|
|
|
3
3
|
entry: {
|
|
4
4
|
lambdaAPIGatewayEvent: string;
|
|
5
5
|
lambdaEventBridgeEvent: string;
|
|
6
|
+
lambdaEventOriginRequest: string;
|
|
7
|
+
lambdaEventViewerRequest: string;
|
|
6
8
|
};
|
|
7
9
|
resolveLoader: {
|
|
8
10
|
modules: string[];
|
|
9
11
|
};
|
|
10
12
|
mode: string;
|
|
13
|
+
optimization: {
|
|
14
|
+
splitChunks: {
|
|
15
|
+
chunks: string;
|
|
16
|
+
automaticNameDelimiter: string;
|
|
17
|
+
cacheGroups: {
|
|
18
|
+
vendors: {
|
|
19
|
+
test: RegExp;
|
|
20
|
+
priority: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
11
25
|
target: string;
|
|
12
26
|
output: {
|
|
13
27
|
path: string;
|
package/lib/webpack.config.js
CHANGED
|
@@ -23,21 +23,43 @@ const getWebpackConfig = (qpqConfig, buildPath, outputPrefix) => {
|
|
|
23
23
|
process.env.QPQLoaderConfig = JSON.stringify({
|
|
24
24
|
allSrcEntries,
|
|
25
25
|
rootDir: path_1.default.resolve(buildPath, '..'),
|
|
26
|
+
qpqConfig,
|
|
26
27
|
});
|
|
27
28
|
return {
|
|
28
29
|
entry: {
|
|
29
30
|
lambdaAPIGatewayEvent: 'quidproquo-deploy-awscdk/src/lambdas/lambdaAPIGatewayEvent.ts',
|
|
30
31
|
lambdaEventBridgeEvent: 'quidproquo-deploy-awscdk/src/lambdas/lambdaEventBridgeEvent.ts',
|
|
32
|
+
lambdaEventOriginRequest: 'quidproquo-deploy-awscdk/src/lambdas/lambdaEventOriginRequest.ts',
|
|
33
|
+
lambdaEventViewerRequest: 'quidproquo-deploy-awscdk/src/lambdas/lambdaEventViewerRequest.ts',
|
|
31
34
|
},
|
|
32
35
|
resolveLoader: {
|
|
33
36
|
modules: [path_1.default.resolve(__dirname, 'loaders'), 'node_modules'],
|
|
34
37
|
},
|
|
35
|
-
mode: getWebpackBuildMode(qpqConfig),
|
|
38
|
+
// mode: getWebpackBuildMode(qpqConfig),
|
|
39
|
+
mode: 'production',
|
|
40
|
+
// externals: ({ request }: { request: string }, callback: any) => {
|
|
41
|
+
// if (/^@aws-sdk\//.test(request)) {
|
|
42
|
+
// return callback(null, `commonjs ${request}`);
|
|
43
|
+
// }
|
|
44
|
+
// callback();
|
|
45
|
+
// },
|
|
46
|
+
optimization: {
|
|
47
|
+
splitChunks: {
|
|
48
|
+
chunks: 'all',
|
|
49
|
+
automaticNameDelimiter: '.',
|
|
50
|
+
cacheGroups: {
|
|
51
|
+
vendors: {
|
|
52
|
+
test: /[\\/]node_modules[\\/]/,
|
|
53
|
+
priority: -10,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
36
58
|
target: 'node',
|
|
37
59
|
output: {
|
|
38
60
|
// Output path
|
|
39
61
|
path: buildPath,
|
|
40
|
-
filename: '[name].js',
|
|
62
|
+
filename: '[name]/index.js',
|
|
41
63
|
// Allow compiling as a lib ~ don't tree shake my exports plz
|
|
42
64
|
globalObject: 'this',
|
|
43
65
|
libraryTarget: 'commonjs2',
|
|
@@ -66,6 +88,7 @@ const getWebpackConfig = (qpqConfig, buildPath, outputPrefix) => {
|
|
|
66
88
|
},
|
|
67
89
|
],
|
|
68
90
|
},
|
|
91
|
+
// plugins: [new BundleAnalyzerPlugin()],
|
|
69
92
|
};
|
|
70
93
|
};
|
|
71
94
|
exports.getWebpackConfig = getWebpackConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-deploy-webpack",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/webpack.config.js",
|
|
6
6
|
"types": "./lib/webpack.config.d.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"clean": "npx rimraf lib",
|
|
13
13
|
"build": "npm run clean && tsc",
|
|
14
|
-
"watch": "
|
|
14
|
+
"watch": "tsc -w"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"esbuild": "^0.15.16",
|
|
32
32
|
"quidproquo-actionprocessor-awslambda": "*",
|
|
33
33
|
"quidproquo-actionprocessor-node": "*",
|
|
34
|
-
"quidproquo-deploy-awscdk": "*",
|
|
35
34
|
"quidproquo-core": "*",
|
|
35
|
+
"quidproquo-deploy-awscdk": "*",
|
|
36
36
|
"quidproquo-webserver": "*"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -43,10 +43,12 @@
|
|
|
43
43
|
"@types/babel__traverse": "7.18.2",
|
|
44
44
|
"@types/node": "^10.17.60",
|
|
45
45
|
"@types/prettier": "2.6.0",
|
|
46
|
+
"@types/webpack-bundle-analyzer": "^4.6.0",
|
|
46
47
|
"babel-loader": "^9.1.2",
|
|
47
48
|
"quidproquo-tsconfig": "*",
|
|
48
49
|
"ts-node": "^10.9.1",
|
|
49
50
|
"typescript": "^4.9.3",
|
|
50
|
-
"webpack": "^5.75.0"
|
|
51
|
+
"webpack": "^5.75.0",
|
|
52
|
+
"webpack-bundle-analyzer": "^4.7.0"
|
|
51
53
|
}
|
|
52
54
|
}
|