@mainset/bundler-webpack 0.3.5 → 0.3.6

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": "@mainset/bundler-webpack",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
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": {
@@ -50,7 +50,7 @@
50
50
  "webpack-merge": "^6.0.1"
51
51
  },
52
52
  "devDependencies": {
53
- "@mainset/cli": "^0.6.1",
53
+ "@mainset/cli": "^0.7.0",
54
54
  "@mainset/dev-stack-fe": "^0.2.2"
55
55
  },
56
56
  "peerDependencies": {
@@ -1,9 +1,47 @@
1
+ // NOTE: keep in sync with the module rules in
2
+ // ./src/webpack-config/config-fragments/module-rules/module-rules.chunk.mts —
3
+ // declaring a pattern the bundler does not resolve makes an import type-check
4
+ // and then fail at build time.
5
+ // !IMPORTANT: TypeScript picks a wildcard by longest prefix, and every pattern
6
+ // below has an empty prefix — so ties are won by the FIRST declaration. The
7
+ // specific patterns must stay above the generic ones, otherwise
8
+ // {styles.module.css} resolves as a plain stylesheet and {icon.source.svg} as a
9
+ // {*.svg} asset URL.
10
+
11
+ // CSS Modules: map of local class name to the generated one
12
+ declare module '*.module.css' {
13
+ const styles: { [className: string]: string };
14
+ export = styles;
15
+ }
1
16
  declare module '*.module.scss' {
2
17
  const styles: { [className: string]: string };
3
18
  export = styles;
4
19
  }
20
+ declare module '*.module.sass' {
21
+ const styles: { [className: string]: string };
22
+ export = styles;
23
+ }
5
24
 
25
+ // NOTE: original, unprocessed SVG content
6
26
  declare module '*.source.svg' {
7
27
  const content: string;
8
28
  export default content;
9
29
  }
30
+
31
+ // NOTE: plain stylesheets are imported for their side effect only
32
+ // ({import './styles.css'}), so they expose no meaningful binding. They need a
33
+ // declaration at all only once {noUncheckedSideEffectImports} is enabled —
34
+ // TypeScript does not check bare side-effect imports by default.
35
+ declare module '*.css';
36
+ declare module '*.scss';
37
+ declare module '*.sass';
38
+
39
+ // NOTE: {asset/resource} — emits the file and exports its public URL
40
+ declare module '*.png' {
41
+ const src: string;
42
+ export default src;
43
+ }
44
+ declare module '*.svg' {
45
+ const src: string;
46
+ export default src;
47
+ }