Merge branch 'webpack-upgrade' into develop

This commit is contained in:
nicolargo 2021-11-11 18:02:36 +01:00
commit 48e35fa98e
8 changed files with 45978 additions and 48041 deletions

View File

@ -39,7 +39,7 @@ docs-server: docs
cd docs/_build/html/ && ../../../venv/bin/python -m http.server $(PORT) cd docs/_build/html/ && ../../../venv/bin/python -m http.server $(PORT)
webui: venv-dev webui: venv-dev
cd glances/outputs/static/ && npm install && npm audit fix && npm run build cd glances/outputs/static/ && npm ci && npm run build
run: venv run: venv
./venv/bin/python -m glances -C ./conf/glances.conf ./venv/bin/python -m glances -C ./conf/glances.conf

View File

@ -7,7 +7,7 @@ You must run the following command from the `glances/outputs/static/` directory.
## Install dependencies ## Install dependencies
```bash ```bash
$ npm install $ npm ci
``` ```
## Build assets ## Build assets

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,30 @@
{ {
"private": true, "private": true,
"dependencies": { "dependencies": {
"angular": "^1.8.0", "angular": "^1.8.2",
"angular-hotkeys": "^1.7.0", "angular-hotkeys": "^1.7.0",
"bootstrap": "^3.4.1", "bootstrap": "^3.4.1",
"favico.js": "^0.3.10", "favico.js": "^0.3.10",
"lodash": "^4.17.21" "lodash": "^4.17.21"
}, },
"devDependencies": { "devDependencies": {
"clean-webpack-plugin": "^0.1.19", "clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^4.6.0", "copy-webpack-plugin": "^9.0.1",
"css-loader": "^0.28.11", "css-loader": "^6.5.1",
"del": "^2.2.1", "del": "^6.0.0",
"exports-loader": "^0.7.0", "html-loader": "^3.0.1",
"file-loader": "^1.1.11", "less": "^4.0.0",
"html-loader": "^0.5.5", "less-loader": "^10.2.0",
"less": "^3.10.3", "ngtemplate-loader": "^2.1.0",
"less-loader": "^4.1.0", "node-sass": "^6.0.1",
"ngtemplate-loader": "^2.0.1", "sass-loader": "^12.3.0",
"node-sass": "^4.14.0", "style-loader": "^3.3.1",
"sass-loader": "^6.0.7", "url-loader": "^4.1.1",
"style-loader": "^0.20.3", "webpack": "^5.63.0",
"url-loader": "^0.6.2", "webpack-cli": "^4.9.1"
"webpack": "^3.12.0"
}, },
"scripts": { "scripts": {
"build": "webpack --bail --progress --profile", "build": "webpack --progress",
"watch": "webpack --bail --progress --profile --watch" "watch": "webpack --progress --watch"
} }
} }

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,19 +2,23 @@
const webpack = require("webpack"); const webpack = require("webpack");
const path = require("path"); const path = require("path");
const CleanWebpackPlugin = require("clean-webpack-plugin"); const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require("copy-webpack-plugin"); const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = { module.exports = {
mode: 'development',
entry: "./js/app.js", entry: "./js/app.js",
output: { output: {
path: path.join(__dirname, "public"), path: path.join(__dirname, "public"),
filename: "glances.js", filename: "glances.js",
sourceMapFilename: "glances.map.js", sourceMapFilename: "glances.map.js",
}, },
devtool: "#source-map", optimization: {
minimize: false,
},
devtool: "source-map",
module: { module: {
loaders: [ rules: [
{ {
test: /\.scss$/, test: /\.scss$/,
use: [{ use: [{
@ -37,29 +41,28 @@ module.exports = {
}, },
{ {
test: /\.css$/, test: /\.css$/,
loader: "style-loader!css-loader", use: [{
}, loader: "style-loader",
{ }, {
test: /\.(png|jpg|gif|svg|ttf|woff|woff2|eot)$/, loader: "css-loader",
loader: "url-loader", }]
options: {
limit: 10000,
}
}, },
{ {
test: /\.html/, test: /\.html/,
loader: "ngtemplate-loader!html-loader" use: [{
}, loader: "ngtemplate-loader",
{ }, {
test: require.resolve("angular"), loader: "html-loader",
loader: "exports-loader?window.angular" }]
}, }
], ],
}, },
plugins: [ plugins: [
new CleanWebpackPlugin("./public/*.*"), new CleanWebpackPlugin(),
new CopyWebpackPlugin([ new CopyWebpackPlugin({
patterns: [
{ from: "./images/favicon.ico" } { from: "./images/favicon.ico" }
]), ]
}),
] ]
}; };