@next-core/build-next-bricks 1.4.0 → 1.4.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/build-next-bricks",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Build next bricks",
5
5
  "homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/build-next-bricks",
6
6
  "license": "GPL-3.0",
@@ -46,5 +46,5 @@
46
46
  "typescript": "^5.0.3",
47
47
  "webpack": "^5.78.0"
48
48
  },
49
- "gitHead": "ea57221d8b3ba0c15ea0ec6c583865c4dce2fb5f"
49
+ "gitHead": "04155db936522cf725c187526ad2510aad3c48fe"
50
50
  }
@@ -23,7 +23,7 @@ export default class EmitBricksJsonPlugin {
23
23
  compilation.hooks.processAssets.tapAsync(
24
24
  {
25
25
  name: pluginName,
26
- stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE,
26
+ stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL,
27
27
  },
28
28
  (compilationAssets, callback) => {
29
29
  const jsEntries = Object.keys(compilationAssets).filter(
package/src/build.js CHANGED
@@ -60,7 +60,6 @@ const getCssLoaders = (cssOptions) => [
60
60
  */
61
61
  async function getWebpackConfig(config) {
62
62
  const packageDir = process.cwd();
63
- // const isContainer = config.type === "container";
64
63
  const isBricks = !config.type || config.type === "bricks";
65
64
  const mode = config.mode || process.env.NODE_ENV;
66
65
 
@@ -126,7 +125,7 @@ async function getWebpackConfig(config) {
126
125
  }
127
126
  );
128
127
  } catch (e) {
129
- console.error(`Shared package not found: "${dep}"`);
128
+ console.warn(`Shared package not found: "${dep}"`);
130
129
  return;
131
130
  }
132
131
  const depPackageJsonFile = await readFile(depPackageJsonPath, {
@@ -181,13 +180,6 @@ async function getWebpackConfig(config) {
181
180
 
182
181
  /** @type {Record<string, { import: string; name: string; }>} */
183
182
  const extraExposes = {};
184
- // const initializeTsPath = path.join(packageDir, "src/initialize.ts");
185
- // if (fs.existsSync(initializeTsPath)) {
186
- // extraExposes.initialize = {
187
- // import: `./${path.relative(packageDir, initializeTsPath)}`,
188
- // name: "initialize",
189
- // };
190
- // }
191
183
 
192
184
  const outputPath = path.join(packageDir, config.outputPath ?? "dist");
193
185
  const chunksDir = isBricks ? "chunks/" : "";
@@ -302,12 +294,6 @@ async function getWebpackConfig(config) {
302
294
  ? {
303
295
  splitChunks: {
304
296
  cacheGroups: {
305
- react: {
306
- test: /[\\/]node_modules[\\/](?:react(?:-dom)?|scheduler)[\\/]/,
307
- priority: -10,
308
- reuseExistingChunk: true,
309
- name: "react",
310
- },
311
297
  default: {
312
298
  minChunks: 2,
313
299
  priority: -20,