@mainset/bundler-webpack 0.2.0-rc.1 → 0.2.0-rc.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.
@@ -6,13 +6,14 @@ import { commonWebpackConfigFragment } from './common.fragment.mjs';
6
6
  // The entry point for Global styles
7
7
  const cssGlobalStylesEntry = path.join(runtimePathById.src, 'styles', 'global.css');
8
8
  const scssGlobalStylesEntry = path.join(runtimePathById.src, 'styles', 'global.scss');
9
- const globalStylesEntry = fs.existsSync(scssGlobalStylesEntry)
10
- ? scssGlobalStylesEntry
11
- : cssGlobalStylesEntry;
9
+ const defaultEntry = [
10
+ resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', '@babel/polyfill'),
11
+ ];
12
+ if (fs.existsSync(cssGlobalStylesEntry))
13
+ defaultEntry.push(cssGlobalStylesEntry);
14
+ if (fs.existsSync(scssGlobalStylesEntry))
15
+ defaultEntry.push(scssGlobalStylesEntry);
12
16
  const commonWebappWebpackConfigFragment = merge(commonWebpackConfigFragment, {
13
- entry: [
14
- resolveHostPackageNodeModulesPath('@mainset/bundler-webpack', '@babel/polyfill'),
15
- globalStylesEntry,
16
- ],
17
+ entry: defaultEntry,
17
18
  });
18
19
  export { commonWebappWebpackConfigFragment };
@@ -1,4 +1,6 @@
1
1
  import { runtimePathById } from '@mainset/cli/runtime';
2
+ import CopyWebpackPlugin from 'copy-webpack-plugin';
3
+ import path from 'path';
2
4
  import { BABEL_LOADER__RULE__WEBPACK_CONFIG_FRAGMENT, FONTS__RULE_TEST_REGEX__WEBPACK_CONFIG_CHUNK, IMAGES__RULE__WEBPACK_CONFIG_FRAGMENT, } from './module-rules/index.mjs';
3
5
  const commonWebpackConfigFragment = {
4
6
  output: {
@@ -26,5 +28,16 @@ const commonWebpackConfigFragment = {
26
28
  '.tsx',
27
29
  ],
28
30
  },
31
+ plugins: [
32
+ new CopyWebpackPlugin({
33
+ patterns: [
34
+ {
35
+ from: path.join(runtimePathById.root, 'public'),
36
+ to: path.join(runtimePathById.dist),
37
+ noErrorOnMissing: true, // optional: don't error if public doesn't exist
38
+ },
39
+ ],
40
+ }),
41
+ ],
29
42
  };
30
43
  export { commonWebpackConfigFragment };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mainset/bundler-webpack",
3
- "version": "0.2.0-rc.1",
3
+ "version": "0.2.0-rc.2",
4
4
  "description": "Bundler for web apps",
5
5
  "homepage": "https://github.com/mainset/dev-stack-fe/tree/main/packages/bundler-webpack",
6
6
  "bugs": {
@@ -29,6 +29,7 @@
29
29
  "@babel/preset-react": "^7.27.1",
30
30
  "@babel/preset-typescript": "^7.27.1",
31
31
  "babel-loader": "^10.0.0",
32
+ "copy-webpack-plugin": "^13.0.0",
32
33
  "css-loader": "^7.1.2",
33
34
  "html-webpack-plugin": "^5.6.3",
34
35
  "mini-css-extract-plugin": "^2.9.2",
@@ -44,7 +45,7 @@
44
45
  "webpack-dev-server": "^5.2.2"
45
46
  },
46
47
  "devDependencies": {
47
- "@mainset/cli": "^0.2.0-rc.1",
48
+ "@mainset/cli": "^0.2.0-rc.2",
48
49
  "@mainset/dev-stack-fe": "^0.1.1",
49
50
  "@mainset/toolkit-js": "^0.1.0"
50
51
  },