@anansi/webpack-config 21.1.7 → 21.1.8
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/CHANGELOG.md +6 -0
- package/README.md +45 -5
- package/index.d.ts +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [21.1.8](/github.com/ntucker/anansi/compare/@anansi/webpack-config@21.1.7...@anansi/webpack-config@21.1.8) (2026-01-02)
|
|
7
|
+
|
|
8
|
+
### 📝 Documentation
|
|
9
|
+
|
|
10
|
+
* Make docs and types consistent with runtime code ([09eba2f](/github.com/ntucker/anansi/commit/09eba2fb8b114090ef52c080e834cce30e110ab5))
|
|
11
|
+
|
|
6
12
|
## [21.1.7](/github.com/ntucker/anansi/compare/@anansi/webpack-config@21.1.6...@anansi/webpack-config@21.1.7) (2025-12-31)
|
|
7
13
|
|
|
8
14
|
### 📦 Package
|
package/README.md
CHANGED
|
@@ -308,6 +308,18 @@ changes.
|
|
|
308
308
|
|
|
309
309
|
`webpack --mode=production --env nohash`
|
|
310
310
|
|
|
311
|
+
### name
|
|
312
|
+
|
|
313
|
+
Override the entry name (defaults to 'App').
|
|
314
|
+
|
|
315
|
+
`webpack --env name=MyApp`
|
|
316
|
+
|
|
317
|
+
### entrypath
|
|
318
|
+
|
|
319
|
+
Override the entry file path (defaults to `./${basePath}`).
|
|
320
|
+
|
|
321
|
+
`webpack --env entrypath=./src/main.tsx`
|
|
322
|
+
|
|
311
323
|
## ENV customization
|
|
312
324
|
|
|
313
325
|
Environmental variable control is sometimes useful in CI pipelines
|
|
@@ -343,6 +355,14 @@ Setting to 'true' will disable all hot reloading functionality (only enabled by
|
|
|
343
355
|
|
|
344
356
|
Sets [webpack cache type](https://webpack.js.org/configuration/cache/).
|
|
345
357
|
|
|
358
|
+
### WEBPACK_NO_CACHE
|
|
359
|
+
|
|
360
|
+
Setting to 'true' will disable webpack caching entirely. Equivalent to `WEBPACK_CACHE=none`.
|
|
361
|
+
|
|
362
|
+
### WEBPACK_ANALYZE
|
|
363
|
+
|
|
364
|
+
Setting to 'true' will enable bundle analysis, equivalent to `--env analyze`.
|
|
365
|
+
|
|
346
366
|
## Options
|
|
347
367
|
|
|
348
368
|
Pass these to makeConfig.
|
|
@@ -361,6 +381,21 @@ const myConfig = makeConfig({
|
|
|
361
381
|
});
|
|
362
382
|
```
|
|
363
383
|
|
|
384
|
+
### pkg
|
|
385
|
+
|
|
386
|
+
Pass your `package.json` object to enable automatic configuration based on package settings.
|
|
387
|
+
When targeting node (`--target=node`), this configures the output path and filename based on `pkg.main` or `pkg.publishConfig.main`.
|
|
388
|
+
Also used to determine the module type when `library.type` is not specified.
|
|
389
|
+
|
|
390
|
+
```js
|
|
391
|
+
const pkg = require('./package.json');
|
|
392
|
+
|
|
393
|
+
const myConfig = makeConfig({
|
|
394
|
+
pkg,
|
|
395
|
+
library: true,
|
|
396
|
+
});
|
|
397
|
+
```
|
|
398
|
+
|
|
364
399
|
### libraryInclude/libraryExclude
|
|
365
400
|
|
|
366
401
|
Regex to match libraries to include in the normal build process. This is useful for
|
|
@@ -435,7 +470,12 @@ Output directory for production server builds. Used when using `--target=node` c
|
|
|
435
470
|
|
|
436
471
|
### mode: argv?.mode || process.env.NODE_ENV
|
|
437
472
|
|
|
438
|
-
Override the [mode](https://
|
|
473
|
+
Override the [mode](https://webpack.js.org/configuration/mode/)
|
|
474
|
+
|
|
475
|
+
### nohash
|
|
476
|
+
|
|
477
|
+
When true, removes content hashes from output filenames. This is useful for diffing bundle sizes
|
|
478
|
+
as it keeps filenames stable across builds. Can also be set via `--env nohash` CLI argument.
|
|
439
479
|
|
|
440
480
|
### htmlOptions
|
|
441
481
|
|
|
@@ -473,13 +513,13 @@ Can configure how [MiniCssExtractPlugin](https://github.com/webpack-contrib/mini
|
|
|
473
513
|
|
|
474
514
|
[Configuration options](https://github.com/webpack-contrib/mini-css-extract-plugin#options)
|
|
475
515
|
|
|
476
|
-
###
|
|
516
|
+
### tsconfigPathsOptions
|
|
477
517
|
|
|
478
518
|
Enabled by default. Uses any module resolution specifications like aliases in `tsconfig`.
|
|
479
519
|
|
|
480
520
|
Set to `false` to disable; or set to object to configure the options.
|
|
481
521
|
|
|
482
|
-
[Configuring tsconfig
|
|
522
|
+
[Configuring tsconfig paths options](https://github.com/dividab/tsconfig-paths-webpack-plugin#options)
|
|
483
523
|
|
|
484
524
|
### fontPreload = 'preload' | 'prefetch'
|
|
485
525
|
|
|
@@ -505,9 +545,9 @@ Override any babel loader specific [options](https://github.com/babel/babel-load
|
|
|
505
545
|
|
|
506
546
|
Any extra loaders to use on JavaScript/TypeScript files.
|
|
507
547
|
|
|
508
|
-
###
|
|
548
|
+
### cssModulesOptions
|
|
509
549
|
|
|
510
|
-
Customize css
|
|
550
|
+
Customize css modules [options](https://github.com/webpack-contrib/css-loader#object).
|
|
511
551
|
|
|
512
552
|
### globalStyleDir = 'style'
|
|
513
553
|
|
package/index.d.ts
CHANGED
|
@@ -25,6 +25,15 @@ export interface Options {
|
|
|
25
25
|
nohash?: boolean;
|
|
26
26
|
argv?: any[];
|
|
27
27
|
env?: any;
|
|
28
|
+
/** Use to compile for libraries rather than web applications */
|
|
29
|
+
library?: Configuration['output']['library'] | boolean;
|
|
30
|
+
/** Pass package.json object for automatic configuration based on package settings */
|
|
31
|
+
pkg?: {
|
|
32
|
+
main?: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
publishConfig?: { main?: string };
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
};
|
|
28
37
|
htmlOptions?: HtmlWebpackPlugin.Options | false;
|
|
29
38
|
svgoOptions?: OptimizeOptions | false;
|
|
30
39
|
svgrOptions?:
|
|
@@ -36,9 +45,11 @@ export interface Options {
|
|
|
36
45
|
globalStyleDir?: string | false;
|
|
37
46
|
sassOptions?: SassOptions | false;
|
|
38
47
|
sassResources?: string[];
|
|
39
|
-
|
|
48
|
+
cssModulesOptions?: any;
|
|
40
49
|
fontPreload?: 'preload' | 'prefetch';
|
|
41
50
|
bundleAnalyzerOptions?: BundleAnalyzerPlugin.Options;
|
|
51
|
+
/** Customize terser options for production builds */
|
|
52
|
+
terserOptions?: any;
|
|
42
53
|
babelLoader?: TransformOptions & {
|
|
43
54
|
cacheDirectory?: string;
|
|
44
55
|
cacheIdentifier?: any;
|