@davidsneighbour/webpack-config 2024.1.2 → 2024.2.0

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.
Files changed (3) hide show
  1. package/README.md +16 -16
  2. package/index.js +78 -78
  3. package/package.json +5 -4
package/README.md CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
  ... to be written ...
4
4
 
5
- # All configurations
5
+ ## All configurations
6
6
 
7
- - [Babel](/packages/babel-config)
8
- - [Bootstrap](/packages/bootstrap-config)
9
- - [Browserslist](/packages/browserslist-config)
10
- - [Commitlint](/packages/commitlint-config)
11
- - [CssNano](/packages/cssnano-config)
12
- - [Cypress](/packages/cypress-config)
13
- - [ESLint](/packages/eslint-config)
14
- - [Markdownlint](/packages/markdownlint-config)
15
- - [PostCSS](/packages/postcss-config)
16
- - [Prettier](/packages/prettier-config)
17
- - [Remark Lint](/packages/remark-config)
18
- - [Standard Version](/packages/standard-version-config)
19
- - [Stylelint](/packages/stylelint-config)
20
- - [Tools](/packages/tools)
21
- - [Webpack](/packages/webpack-config)
7
+ | Configurations | | |
8
+ | --- | --- | --- |
9
+ | **Build Tools** | | |
10
+ | [Babel](packages/babel-config) | [Webpack](packages/webpack-config) | |
11
+ | **Testing** | | |
12
+ | [Cypress](packages/cypress-config) | [HTML Validate](packages/htmlvalidate-config/) | |
13
+ | **Linters and Formatters** | | |
14
+ | [Browserslist](packages/browserslist-config) | [ESLint](packages/eslint-config) | [PostCSS](packages/postcss-config) |
15
+ | [Prettier](packages/prettier-config) | [Stylelint](packages/stylelint-config) | |
16
+ | **Project Management** | | |
17
+ | [Commitlint](packages/commitlint-config) | [Release](packages/release-config) | |
18
+ | **Markdown and Writing** | | |
19
+ | [Markdownlint](packages/markdownlint-config) | [Remark Lint](packages/remark-config) | |
20
+ | **Other Tools** | | |
21
+ | [Bootstrap](packages/bootstrap-config) | [Tools](packages/tools) | |
package/index.js CHANGED
@@ -1,94 +1,94 @@
1
- const path = require("path");
2
- const TerserPlugin = require("terser-webpack-plugin");
1
+ import { resolve as _resolve, join } from "path";
2
+ import TerserPlugin from "terser-webpack-plugin";
3
3
 
4
4
  // module.exports = (env, argv) =>
5
5
  // noinspection JSUnresolvedVariable
6
- module.exports = (env) =>
7
- // noinspection JSUnresolvedVariable
8
- ({
9
- mode: env.production ? "production" : "development",
10
- devtool: env.production ? "source-map" : "inline-source-map",
6
+ export default (env) =>
7
+ // noinspection JSUnresolvedVariable
8
+ ({
9
+ mode: env.production ? "production" : "development",
10
+ devtool: env.production ? "source-map" : "inline-source-map",
11
11
 
12
- context: path.resolve(__dirname, "assets"),
12
+ context: _resolve(__dirname, "assets"),
13
13
 
14
- entry: {
15
- main: path.join(__dirname, "assets/js", "theme.js"),
16
- },
14
+ entry: {
15
+ main: join(__dirname, "assets/js", "theme.js"),
16
+ },
17
17
 
18
- target: ["browserslist"],
18
+ target: ["browserslist"],
19
19
 
20
- output: {
21
- path: path.join(__dirname, "static/assets"),
22
- filename: "[name].js",
23
- chunkFilename: "[id].js",
24
- assetModuleFilename: "[hash][ext][query]",
25
- clean: true,
26
- },
20
+ output: {
21
+ path: join(__dirname, "static/assets"),
22
+ filename: "[name].js",
23
+ chunkFilename: "[id].js",
24
+ assetModuleFilename: "[hash][ext][query]",
25
+ clean: true,
26
+ },
27
27
 
28
- stats: "minimal",
28
+ stats: "minimal",
29
29
 
30
- performance: {
31
- maxEntrypointSize: 400000,
32
- maxAssetSize: 250000,
33
- hints: "warning",
34
- },
30
+ performance: {
31
+ maxEntrypointSize: 400000,
32
+ maxAssetSize: 250000,
33
+ hints: "warning",
34
+ },
35
35
 
36
- optimization: {
37
- minimize: !!env.production,
38
- minimizer: [
39
- new TerserPlugin({
40
- terserOptions: {
41
- format: {
42
- comments: false,
43
- },
44
- },
45
- extractComments: false,
46
- }),
47
- ],
48
- emitOnErrors: true,
49
- moduleIds: "deterministic",
50
- runtimeChunk: "single",
51
- splitChunks: {
52
- cacheGroups: {
53
- vendor: {
54
- test: /[\\/]node_modules[\\/]/,
55
- name: "vendors",
56
- chunks: "all",
36
+ optimization: {
37
+ minimize: !!env.production,
38
+ minimizer: [
39
+ new TerserPlugin({
40
+ terserOptions: {
41
+ format: {
42
+ comments: false,
57
43
  },
58
44
  },
45
+ extractComments: false,
46
+ }),
47
+ ],
48
+ emitOnErrors: true,
49
+ moduleIds: "deterministic",
50
+ runtimeChunk: "single",
51
+ splitChunks: {
52
+ cacheGroups: {
53
+ vendor: {
54
+ test: /[\\/]node_modules[\\/]/,
55
+ name: "vendors",
56
+ chunks: "all",
57
+ },
59
58
  },
60
- mangleWasmImports: true,
61
- mangleExports: "deterministic",
62
59
  },
60
+ mangleWasmImports: true,
61
+ mangleExports: "deterministic",
62
+ },
63
63
 
64
- module: {
65
- rules: [
66
- {
67
- test: /\.tsx?$/,
68
- use: 'ts-loader',
69
- exclude: /node_modules/,
70
- },
71
- {
72
- loader: "babel-loader",
73
- test: /\.js?$/,
74
- exclude: /node_modules/,
75
- },
76
- {
77
- test: /\.css$/i,
78
- use: ["style-loader", "css-loader", "postcss-loader"],
79
- },
80
- {
81
- test: /\.(png|svg|jpg|jpeg|gif)$/i,
82
- type: "asset/resource",
83
- },
84
- {
85
- test: /\.(woff|woff2|eot|ttf|otf)$/i,
86
- type: "asset/resource",
87
- },
88
- ],
89
- },
64
+ module: {
65
+ rules: [
66
+ {
67
+ test: /\.tsx?$/,
68
+ use: 'ts-loader',
69
+ exclude: /node_modules/,
70
+ },
71
+ {
72
+ loader: "babel-loader",
73
+ test: /\.js?$/,
74
+ exclude: /node_modules/,
75
+ },
76
+ {
77
+ test: /\.css$/i,
78
+ use: ["style-loader", "css-loader", "postcss-loader"],
79
+ },
80
+ {
81
+ test: /\.(png|svg|jpg|jpeg|gif)$/i,
82
+ type: "asset/resource",
83
+ },
84
+ {
85
+ test: /\.(woff|woff2|eot|ttf|otf)$/i,
86
+ type: "asset/resource",
87
+ },
88
+ ],
89
+ },
90
90
 
91
- resolve: {
92
- extensions: ['.tsx', '.ts', '.js'],
93
- },
94
- });
91
+ resolve: {
92
+ extensions: ['.tsx', '.ts', '.js'],
93
+ },
94
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@davidsneighbour/webpack-config",
3
3
  "description": "Webpack configuration for use in @davidsneighbour projects.",
4
- "version": "2024.1.2",
4
+ "version": "2024.2.0",
5
5
  "license": "MIT",
6
6
  "repository": "davidsneighbour/configurations",
7
7
  "author": "Patrick Kollitsch <patrick@davids-neighbour.com> (https://davids-neighbour.com)",
@@ -25,8 +25,9 @@
25
25
  },
26
26
  "main": "index.js",
27
27
  "engines": {
28
- "node": ">=20.9.0",
29
- "npm": ">=10.4.0"
28
+ "node": ">=20.12.0",
29
+ "npm": ">=10.5.0"
30
30
  },
31
- "gitHead": "ae949fa5972d2dae69398f60c2fc25be0d97e8d3"
31
+ "gitHead": "4e5fc203de312ab82d37a47e77a8c31ebf01705e",
32
+ "type": "module"
32
33
  }