Skip to content

Commit d5f2cea

Browse files
authored
chore(deps): update all bundling dependencies (#227)
Updates all webpack and babel related dependencies. Replaces the `node.fs === "empty"` webpack option with `resolve.fallback.fs === false`. Moves the `devtool` webpack option to a ternary expression after defining the base configuration because `""` is no longer a valid value for the `devtool` option. Adds the `.vue` file extension to all import statements. Renames a deterministic bundle ID reference to whatever webpack now came up with. I haven’t got a single clue why it changed it in the first place.
1 parent 35d10a5 commit d5f2cea

File tree

10 files changed

+7397
-6577
lines changed

10 files changed

+7397
-6577
lines changed

package-lock.json

Lines changed: 7357 additions & 6545 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
"scripts": {
88
"start": "npm run watch",
99
"watch": "npm-run-all --parallel watch:server watch:build",
10-
"watch:build": "webpack --progress --colors --watch",
10+
"watch:build": "webpack --progress --color --watch",
1111
"watch:server": "nodemon server.js",
1212
"test": "jest",
1313
"test:watch": "jest --watchAll",
14-
"build": "webpack --progress --colors",
14+
"build": "webpack --progress --color",
1515
"alex": "alex",
1616
"lint": "eslint --ext .js,.vue public",
1717
"lint:fix": "eslint --fix --ext .js,.vue public"
1818
},
1919
"dependencies": {
2020
"@azure/core-amqp": "^1.1.0",
2121
"@azure/event-hubs": "^5.0.1",
22-
"@babel/runtime": "^7.6.2",
22+
"@babel/runtime": "^7.12.5",
2323
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
2424
"azure-iothub": "^1.11.0",
2525
"body-parser": "^1.19.0",
@@ -46,20 +46,20 @@
4646
],
4747
"license": "MIT",
4848
"devDependencies": {
49-
"@babel/cli": "7.8.4",
50-
"@babel/core": "7.8.4",
51-
"@babel/plugin-syntax-jsx": "7.8.3",
52-
"@babel/plugin-transform-modules-commonjs": "7.8.3",
53-
"@babel/plugin-transform-runtime": "7.8.3",
54-
"@babel/preset-env": "7.8.4",
49+
"@babel/cli": "7.12.10",
50+
"@babel/core": "7.12.10",
51+
"@babel/plugin-syntax-jsx": "7.12.1",
52+
"@babel/plugin-transform-modules-commonjs": "7.12.1",
53+
"@babel/plugin-transform-runtime": "7.12.10",
54+
"@babel/preset-env": "7.12.11",
5555
"@babel/preset-stage-2": "7.8.3",
5656
"@types/jest": "25.1.2",
5757
"@vue/test-utils": "1.1.2",
5858
"alex": "8.1.1",
5959
"babel-jest": "25.1.0",
60-
"babel-loader": "8.0.6",
60+
"babel-loader": "8.2.2",
6161
"babel-minify-webpack-plugin": "0.3.1",
62-
"css-loader": "3.4.2",
62+
"css-loader": "5.0.1",
6363
"debug": "4.1.1",
6464
"eslint": "7.19.0",
6565
"eslint-plugin-vue": "7.5.0",
@@ -68,13 +68,13 @@
6868
"jest-axe": "3.3.0",
6969
"nodemon": "2.0.2",
7070
"npm-run-all": "4.1.5",
71-
"style-loader": "1.1.3",
71+
"style-loader": "2.0.0",
7272
"supertest": "4.0.2",
7373
"vue-jest": "4.0.0-rc.1",
7474
"vue-loader": "15.9.6",
7575
"vue-template-compiler": "2.6.12",
76-
"webpack": "4.41.6",
77-
"webpack-cli": "3.3.11",
76+
"webpack": "5.19.0",
77+
"webpack-cli": "4.4.0",
7878
"webpack-watch-server": "1.2.1",
7979
"whatwg-fetch": "3.0.0"
8080
},

public/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@
2525
<div id="app"></div>
2626
<div id="dialog-root" class="modal-wrapper"></div>
2727

28-
<script src="/js/dist/vendors~main.bundle.js"></script>
28+
<!--
29+
For whatever unholy reason, webpack 5 changed the deterministic bundle ID
30+
from “vendors~main” to “166” for this bundle
31+
and I can’t be bothered to figure out how to revert that.
32+
-->
33+
<script src="/js/dist/166.bundle.js"></script>
2934
<script src="/js/dist/main.bundle.js"></script>
3035
</body>
3136
</html>

public/js/components/CardForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</template>
4444

4545
<script>
46-
import FormFields from "./FormFields";
46+
import FormFields from "./FormFields.vue";
4747
4848
export default {
4949
name: "CardForm",

public/js/components/DashboardSettings.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119

120120
<script>
121121
import ElectricColorPicker from "./ElectricColorPicker.vue";
122-
import { saveDashboard } from "../lib/configuration.js";
123122
import templates from "../lib/templates.js";
124123
import createGuid from "../lib/guid.js";
125124

public/js/components/FormFields.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
</template>
88

99
<script>
10-
import ButtonSettings from "./ButtonSettings";
11-
import LineChartSettings from "./LineChartSettings";
12-
import NumberSettings from "./NumberSettings";
13-
import StickerSettings from "./StickerSettings";
14-
import TextSettings from "./TextSettings";
10+
import ButtonSettings from "./ButtonSettings.vue";
11+
import LineChartSettings from "./LineChartSettings.vue";
12+
import NumberSettings from "./NumberSettings.vue";
13+
import StickerSettings from "./StickerSettings.vue";
14+
import TextSettings from "./TextSettings.vue";
1515
1616
export default {
1717
name: "FormFields",

public/js/components/LineChartCard.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<script>
1010
import Chartist from "chartist";
11+
1112
import { evaluatePath } from "../lib/messagePropertyEvaluation.js";
1213
1314
export default {

public/js/components/TextCard.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<script>
88
import marked from "marked";
9+
910
export default {
1011
name: "TextCard",
1112

public/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from "vue";
2-
import App from "./components/App";
2+
import App from "./components/App.vue";
33
import VueA11yDialog from "vue-a11y-dialog";
44
import "chartist/dist/chartist.min.css";
55

webpack.config.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
const webpack = require("webpack");
22
const path = require("path");
33
const VueLoaderPlugin = require("vue-loader/lib/plugin");
4-
const mode =
5-
process.env.NODE_ENV === "development" ? "development" : "production";
64

7-
module.exports = {
5+
const mode = process.env.NODE_ENV === "development" ? "development" : "production";
6+
7+
const baseConfiguration = {
88
mode: mode,
99
entry: "./public/js/main.js",
1010
output: {
1111
path: path.resolve(__dirname, "public", "js", "dist"),
1212
publicPath: "/dist/",
13-
chunkFilename: "[name].bundle.js",
1413
filename: "[name].bundle.js"
1514
},
1615
optimization: {
1716
splitChunks: {
1817
chunks: "all"
1918
}
2019
},
21-
devtool: mode === "production" ? "" : "eval-source-map",
2220
resolve: {
2321
extensions: [".js", ".vue"],
2422
alias: {
2523
vue$: "vue/dist/vue.esm.js",
2624
chartist$: "chartist/dist/chartist.min.js"
25+
},
26+
fallback: {
27+
fs: false
2728
}
2829
},
2930
module: {
@@ -51,8 +52,9 @@ module.exports = {
5152
new webpack.DefinePlugin({
5253
SIMULATING: process.env.SIMULATING
5354
})
54-
],
55-
node: {
56-
fs: "empty"
57-
}
55+
]
5856
};
57+
58+
module.exports = mode === "production"
59+
? baseConfiguration
60+
: { ...baseConfiguration, devtool: "eval-source-map" };

0 commit comments

Comments
 (0)