@caweb/webpack 1.5.9 → 1.5.11

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 (2) hide show
  1. package/package.json +7 -11
  2. package/webpack.config.js +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/webpack",
3
- "version": "1.5.9",
3
+ "version": "1.5.11",
4
4
  "description": "CAWebPublishing Webpack Configuration",
5
5
  "main": "webpack.config.js",
6
6
  "files": [
@@ -12,11 +12,7 @@
12
12
  "scripts": {
13
13
  "webpack": "webpack",
14
14
  "serve": "webpack serve --config ./plugins/html/webpack.config.js",
15
- "u:deps": "node ./scripts/update-deps.js ./plugins",
16
- "test": "echo \\\"Error: run tests from root\\\" && exit 0",
17
- "i:deps": "npm i @caweb/a11y-webpack-plugin @caweb/css-audit-webpack-plugin @caweb/html-webpack-plugin @caweb/jshint-webpack-plugin",
18
- "i:local": "npm i plugins/a11y/ plugins/css-audit/ plugins/html/ plugins/jshint/ ",
19
- "un:local": "npm un @caweb/a11y-webpack-plugin @caweb/css-audit-webpack-plugin @caweb/html-webpack-plugin @caweb/jshint-webpack-plugin --force"
15
+ "test": "echo \\\"Error: run tests from root\\\" && exit 0"
20
16
  },
21
17
  "repository": {
22
18
  "type": "git",
@@ -38,17 +34,17 @@
38
34
  "homepage": "https://github.com/CAWebPublishing/webpack#readme",
39
35
  "dependencies": {
40
36
  "@babel/plugin-proposal-class-properties": "^7.18.6",
41
- "@wordpress/scripts": "^30.20.0",
42
- "css-minimizer-webpack-plugin": "^7.0.2",
37
+ "@wordpress/scripts": "^31.2.0",
38
+ "css-minimizer-webpack-plugin": "^7.0.4",
43
39
  "handlebars-loader": "^1.7.3",
44
40
  "html-format": "^1.1.7",
45
41
  "html-webpack-link-type-plugin": "^1.1.1",
46
42
  "html-webpack-skip-assets-plugin": "^1.0.4",
47
- "mini-css-extract-plugin": "^2.9.2",
43
+ "mini-css-extract-plugin": "^2.9.4",
48
44
  "rtlcss-webpack-plugin": "^4.0.7",
49
- "thread-loader": "^4.0.2",
45
+ "thread-loader": "^4.0.4",
50
46
  "ts-loader": "^9.5.4",
51
- "webpack": "^5.102.1",
47
+ "webpack": "^5.104.1",
52
48
  "webpack-dev-server": "^5.2.2",
53
49
  "webpack-remove-empty-scripts": "^1.1.1"
54
50
  },
package/webpack.config.js CHANGED
@@ -361,6 +361,15 @@ if( 'serve' === webpackCommand ){
361
361
  */
362
362
  {
363
363
  directory: path.join(appPath, 'node_modules'),
364
+ },
365
+ /**
366
+ * Static files are served from the following files in the following order
367
+ * we don't have to add the build directory since that is the output.path and proxied
368
+ *
369
+ * node_modules - Allows loading files from other npm packages
370
+ */
371
+ {
372
+ directory: path.join(appPath, 'media'),
364
373
  }
365
374
  ],
366
375
  proxy:[
@@ -383,6 +392,14 @@ if( 'serve' === webpackCommand ){
383
392
  context: ['/node_modules'],
384
393
  target: `${server}://${host}:${port}`,
385
394
  pathRewrite: { '^/node_modules': '' },
395
+ },
396
+ /**
397
+ * We proxy the node_modules and src so they serve from the root
398
+ */
399
+ {
400
+ context: ['/media'],
401
+ target: `${server}://${host}:${port}`,
402
+ pathRewrite: { '^/media': '' },
386
403
  }
387
404
  ]
388
405
  }