Skip to content

Commit 0ff2c88

Browse files
committed
maint: Update webpack and bundle config.
1 parent e7ebe0b commit 0ff2c88

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed
File renamed without changes.

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
// Webpack entry point for module federation.
2-
import "@patternslib/patternslib/webpack/module_federation";
3-
// The next import needs to be kept with brackets, otherwise we get this error:
4-
// "Shared module is not available for eager consumption."
5-
import("./bundle-config");
2+
// This import needs to be kept with brackets.
3+
import("./bundle");

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@
99
"prismjs": "^1.28.0"
1010
},
1111
"devDependencies": {
12-
"@patternslib/dev": "^2.2.0",
13-
"@patternslib/patternslib": "*"
12+
"@patternslib/dev": "^3.1.6",
13+
"@patternslib/patternslib": ">=9.8.0-beta.0"
1414
},
1515
"scripts": {
1616
"start": "NODE_ENV=development webpack serve --config webpack.config.js",
17+
"watch": "NODE_ENV=development webpack --config webpack.config.js --watch",
1718
"build": "NODE_ENV=production webpack --config webpack.config.js",
1819
"build:dev": "NODE_ENV=development webpack --config webpack.config.js",
1920
"build:stats": "NODE_ENV=production webpack --config webpack.config.js --json > stats.json",
2021
"test": "jest"
2122
},
22-
"browserslist": {
23-
"production": [
24-
">0.2%",
25-
"not dead",
26-
"not op_mini all"
27-
]
28-
},
23+
"browserslist": [
24+
">0.2%",
25+
"not dead"
26+
],
2927
"keywords": [
3028
"patternslib"
3129
],

webpack.config.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
process.traceDeprecation = true;
22
const mf_config = require("@patternslib/dev/webpack/webpack.mf");
33
const package_json = require("./package.json");
4+
const package_json_patternslib = require("@patternslib/patternslib/package.json");
45
const path = require("path");
5-
const patternslib_config = require("@patternslib/dev/webpack/webpack.config.js");
6-
const patternslib_package_json = require("@patternslib/patternslib/package.json");
6+
const webpack_config = require("@patternslib/dev/webpack/webpack.config").config;
77

8-
module.exports = async (env, argv) => {
8+
module.exports = () => {
99
let config = {
1010
entry: {
1111
"bundle.min": path.resolve(__dirname, "index.js"),
1212
},
1313
};
1414

15-
config = patternslib_config(env, argv, config);
15+
config = webpack_config({
16+
config: config,
17+
package_json: package_json,
18+
});
1619
config.output.path = path.resolve(__dirname, "dist/");
1720

1821
config.plugins.push(
1922
mf_config({
2023
name: package_json.name,
2124
remote_entry: config.entry["bundle.min"],
2225
dependencies: {
23-
...patternslib_package_json.dependencies,
26+
...package_json_patternslib.dependencies,
2427
...package_json.dependencies,
2528
},
2629
})

0 commit comments

Comments
 (0)