Skip to content

Commit a72d4fb

Browse files
authored
Merge 00644dc into a6d516d
2 parents a6d516d + 00644dc commit a72d4fb

File tree

7 files changed

+290
-42
lines changed

7 files changed

+290
-42
lines changed

config/webpack.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
const path = require('path');
1919
const webpack = require('webpack');
20+
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
2021

2122
/**
2223
* A regular expression used to replace Firestore's and Storage's platform-
@@ -28,6 +29,11 @@ const PLATFORM_RE = /^(.*)\/platform\/([^.\/]*)(\.ts)?$/;
2829
module.exports = {
2930
mode: 'development',
3031
devtool: 'source-map',
32+
optimization: {
33+
runtimeChunk: false,
34+
splitChunks: false,
35+
minimize: false
36+
},
3137
module: {
3238
rules: [
3339
{
@@ -108,6 +114,7 @@ module.exports = {
108114
`$1/platform/${targetPlatform}/$2.ts`
109115
);
110116
}),
117+
new NodePolyfillPlugin(),
111118
new webpack.EnvironmentPlugin([
112119
'RTDB_EMULATOR_PORT',
113120
'RTDB_EMULATOR_NAMESPACE'

integration/firebase/test/namespace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import firebase from 'firebase/compat';
18+
import firebase from 'firebase/compat/app';
1919
import * as namespaceDefinition from './namespaceDefinition.json';
2020
import validateNamespace from './validator';
2121

integration/firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"mocha": "9.2.2",
3232
"ts-loader": "8.4.0",
3333
"typescript": "4.2.2",
34-
"webpack": "4.46.0",
34+
"webpack": "5.76.0",
3535
"webpack-stream": "6.1.2"
3636
}
3737
}

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"size-report": "ts-node-script scripts/size_report/report_binary_size.ts",
4646
"modular-export-size-report": "ts-node-script scripts/size_report/report_modular_export_binary_size.ts",
4747
"api-report": "lerna run --scope @firebase/* api-report",
48-
"postinstall": "yarn --cwd repo-scripts/changelog-generator build",
48+
"postinstall": "patch-package && yarn --cwd repo-scripts/changelog-generator build",
4949
"sa": "ts-node-script repo-scripts/size-analysis/cli.ts",
5050
"api-documenter-devsite": "ts-node-script repo-scripts/api-documenter/src/start.ts",
5151
"format": "ts-node ./scripts/format/format.ts"
@@ -122,7 +122,7 @@
122122
"karma-sourcemap-loader": "0.3.8",
123123
"karma-spec-reporter": "0.0.34",
124124
"karma-summary-reporter": "3.1.1",
125-
"karma-webpack": "4.0.2",
125+
"karma-webpack": "5.0.0",
126126
"lcov-result-merger": "3.1.0",
127127
"lerna": "4.0.0",
128128
"listr": "0.14.3",
@@ -151,7 +151,13 @@
151151
"typedoc": "0.16.11",
152152
"typescript": "4.7.4",
153153
"watch": "1.0.2",
154-
"webpack": "4.46.0",
154+
"webpack": "5.76.0",
155155
"yargs": "17.7.1"
156+
},
157+
"dependencies": {
158+
"node-polyfill-webpack-plugin": "2.0.1",
159+
"patch-package": "7.0.0",
160+
"postinstall-postinstall": "2.1.0",
161+
"stream-browserify": "3.0.0"
156162
}
157163
}

patches/karma-webpack+5.0.0.patch

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/node_modules/karma-webpack/lib/webpack/plugin.js b/node_modules/karma-webpack/lib/webpack/plugin.js
2+
index 47b993c..3b75a9e 100644
3+
--- a/node_modules/karma-webpack/lib/webpack/plugin.js
4+
+++ b/node_modules/karma-webpack/lib/webpack/plugin.js
5+
@@ -1,4 +1,5 @@
6+
const fs = require('fs');
7+
+const path = require('path');
8+
9+
class KW_WebpackPlugin {
10+
constructor(options) {
11+
@@ -14,9 +15,10 @@ class KW_WebpackPlugin {
12+
// read generated file content and store for karma preprocessor
13+
this.controller.bundlesContent = {};
14+
stats.toJson().assets.forEach((webpackFileObj) => {
15+
- const filePath = `${compiler.options.output.path}/${
16+
+ const filePath = path.resolve(
17+
+ compiler.options.output.path,
18+
webpackFileObj.name
19+
- }`;
20+
+ );
21+
this.controller.bundlesContent[webpackFileObj.name] = fs.readFileSync(
22+
filePath,
23+
'utf-8'

repo-scripts/size-analysis/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"rollup-plugin-replace": "2.2.0",
2727
"rollup-plugin-typescript2": "0.31.2",
2828
"@rollup/plugin-virtual": "2.1.0",
29-
"webpack": "4.46.0",
29+
"webpack": "5.76.0",
3030
"@types/webpack": "5.28.0",
3131
"webpack-virtual-modules": "0.5.0",
3232
"child-process-promise": "2.2.1",

0 commit comments

Comments
 (0)