@vyriy/webpack-config 0.1.12 → 0.1.16

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/README.md CHANGED
@@ -64,17 +64,32 @@ export default csr(
64
64
  clean: true,
65
65
  },
66
66
  {
67
- output: {
68
- filename: 'app.js',
67
+ optimization: {
68
+ splitChunks: true,
69
69
  },
70
70
  },
71
71
  );
72
72
  ```
73
73
 
74
+ With types:
75
+
76
+ ```ts
77
+ import { csr, type WebpackConfig } from '@vyriy/webpack-config';
78
+
79
+ const config: WebpackConfig = csr('./src/index.tsx', {
80
+ path: '/absolute/path/to/dist/client',
81
+ filename: 'index.js',
82
+ clean: true,
83
+ });
84
+
85
+ export default config;
86
+ ```
87
+
74
88
  ## API
75
89
 
76
90
  - `csr(entry, output, config?)` creates a browser-oriented Webpack config.
77
91
  - `ssr(entry, output, config?)` creates a node-oriented SSR Webpack config.
92
+ - `WebpackConfig`, `WebpackEntry`, and `WebpackOutput` expose the shared config helper types.
78
93
 
79
94
  Shared defaults:
80
95
 
package/csr.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Configuration } from 'webpack';
2
- export declare const csr: (entry: Configuration["entry"], output: Configuration["output"], config?: Configuration) => Configuration;
1
+ import type { WebpackConfig, WebpackEntry, WebpackOutput } from './types.js';
2
+ export declare const csr: (entry: WebpackEntry, output: WebpackOutput, config?: WebpackConfig) => WebpackConfig;
package/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './csr.js';
2
2
  export * from './ssr.js';
3
+ export type * from './types.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyriy/webpack-config",
3
- "version": "0.1.12",
3
+ "version": "0.1.16",
4
4
  "description": "Shared Webpack config for Vyriy projects",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -12,8 +12,8 @@
12
12
  "@babel/preset-typescript": "^7.28.5",
13
13
  "@babel/runtime": "^7.29.2",
14
14
  "@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
15
- "@vyriy/env": "0.1.12",
16
- "@vyriy/path": "0.1.12",
15
+ "@vyriy/env": "0.1.16",
16
+ "@vyriy/path": "0.1.16",
17
17
  "babel-loader": "^10.1.1",
18
18
  "css-loader": "^7.1.4",
19
19
  "cssnano": "^8.0.1",
package/ssr.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Configuration } from 'webpack';
2
- export declare const ssr: (entry: Configuration["entry"], output: Configuration["output"], config?: Configuration) => Configuration;
1
+ import type { WebpackConfig, WebpackEntry, WebpackOutput } from './types.js';
2
+ export declare const ssr: (entry: WebpackEntry, output: WebpackOutput, config?: WebpackConfig) => WebpackConfig;
package/types.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { Configuration } from 'webpack';
2
+ export type WebpackConfig = Configuration;
3
+ export type WebpackEntry = WebpackConfig['entry'];
4
+ export type WebpackOutput = WebpackConfig['output'];