Import overrides

main
Gerard Braad 2023-06-22 14:10:13 +08:00
parent 94bbe66ddb
commit 478b991c0a
5 changed files with 101 additions and 75 deletions

View File

@ -13,8 +13,8 @@
"@types/react": "^18.2.12", "@types/react": "^18.2.12",
"@types/react-dom": "^18.2.5", "@types/react-dom": "^18.2.5",
"argparse": "^2.0.1", "argparse": "^2.0.1",
"css-loader": "^5.2.6",
"chrome-remote-interface": "^0.32.1", "chrome-remote-interface": "^0.32.1",
"css-loader": "^5.2.6",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.3", "html-webpack-plugin": "^5.5.3",
"htmlparser": "^1.7.7", "htmlparser": "^1.7.7",
@ -22,11 +22,12 @@
"mini-css-extract-plugin": "^1.6.0", "mini-css-extract-plugin": "^1.6.0",
"po2json": "^1.0.0-alpha", "po2json": "^1.0.0-alpha",
"qunit": "^2.9.3", "qunit": "^2.9.3",
"sass": "^1.61.0", "sass": "^1.63.6",
"sass-loader": "^13.3.2",
"sizzle": "^2.3.3", "sizzle": "^2.3.3",
"ts-loader": "^9.4.3", "ts-loader": "^9.4.3",
"typescript": "^4.8.4", "typescript": "^4.8.4",
"webpack": "^5.87.0", "webpack": "^5.88.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1" "webpack-dev-server": "^4.15.1"
}, },

View File

@ -25,7 +25,9 @@ export class Application extends React.Component<ApplicationProps, ApplicationSt
<Card> <Card>
<CardTitle>Tailscale</CardTitle> <CardTitle>Tailscale</CardTitle>
<CardBody> <CardBody>
<pre>
{ this.state.response } { this.state.response }
</pre>
</CardBody> </CardBody>
</Card> </Card>
); );

View File

@ -1,11 +1,12 @@
import "cockpit-dark-theme"; import "cockpit-dark-theme";
//import "patternfly/patternfly-5-cockpit.scss"; //import "@patternfly/patternfly/patternfly-base.scss";
import '@patternfly/react-core/dist/styles/base.css'; import '@patternfly/react-core/dist/styles/base.css';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Application } from './app'; import { Application } from './app';
import "patternfly/patternfly-5-overrides.scss";
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {
ReactDOM.render( ReactDOM.render(

View File

@ -13,84 +13,91 @@ module.exports = {
use: [ use: [
{ {
loader: 'ts-loader', loader: 'ts-loader',
options: { options: {
transpileOnly: true, transpileOnly: true,
experimentalWatchApi: true, experimentalWatchApi: true,
}, },
} }
] ]
}, },
{
test: /\.s[ac]ss$/i,
use: [
"css-loader",
"sass-loader",
],
},
{ {
test: /\.css$/, test: /\.css$/,
include: [...stylePaths], include: [...stylePaths],
use: [MiniCssExtractPlugin.loader, 'css-loader'], use: [MiniCssExtractPlugin.loader, 'css-loader'],
}, { }, {
test: /\.(svg|ttf|eot|woff|woff2)$/, test: /\.(svg|ttf|eot|woff|woff2)$/,
// only process modules with this loader // only process modules with this loader
// if they live under a 'fonts' or 'pficon' directory // if they live under a 'fonts' or 'pficon' directory
include: [ include: [
path.resolve(__dirname, 'node_modules/patternfly/dist/fonts'), path.resolve(__dirname, 'node_modules/patternfly/dist/fonts'),
path.resolve(__dirname, 'node_modules/@patternfly/react-core/dist/styles/assets/fonts'), path.resolve(__dirname, 'node_modules/@patternfly/react-core/dist/styles/assets/fonts'),
path.resolve(__dirname, 'node_modules/@patternfly/react-core/dist/styles/assets/pficon'), path.resolve(__dirname, 'node_modules/@patternfly/react-core/dist/styles/assets/pficon'),
path.resolve(__dirname, 'node_modules/@patternfly/patternfly/assets/fonts'), path.resolve(__dirname, 'node_modules/@patternfly/patternfly/assets/fonts'),
path.resolve(__dirname, 'node_modules/@patternfly/patternfly/assets/pficon'), path.resolve(__dirname, 'node_modules/@patternfly/patternfly/assets/pficon'),
], ],
use: { use: {
loader: 'file-loader', loader: 'file-loader',
options: {
// Limit at 50k. larger files emited into separate files
limit: 5000,
outputPath: 'fonts',
name: '[name].[ext]',
},
},
},
{
test: /\.svg$/,
include: (input) => input.indexOf('background-filter.svg') > 1,
use: [
{
loader: 'url-loader',
options: { options: {
// Limit at 50k. larger files emited into separate files
limit: 5000, limit: 5000,
outputPath: 'fonts', outputPath: 'svgs',
name: '[name].[ext]', name: '[name].[ext]',
}, },
}, },
}, ],
{ },
test: /\.svg$/, {
include: (input) => input.indexOf('background-filter.svg') > 1, test: /\.(jpg|jpeg|png|gif)$/i,
use: [ include: [
{ path.resolve(__dirname, 'src'),
loader: 'url-loader', path.resolve(__dirname, 'node_modules/patternfly'),
options: { path.resolve(__dirname, 'node_modules/@patternfly/patternfly/assets/images'),
limit: 5000, path.resolve(__dirname, 'node_modules/@patternfly/react-styles/css/assets/images'),
outputPath: 'svgs', path.resolve(__dirname, 'node_modules/@patternfly/react-core/dist/styles/assets/images'),
name: '[name].[ext]', path.resolve(
}, __dirname,
'node_modules/@patternfly/react-core/node_modules/@patternfly/react-styles/css/assets/images'
),
path.resolve(
__dirname,
'node_modules/@patternfly/react-table/node_modules/@patternfly/react-styles/css/assets/images'
),
path.resolve(
__dirname,
'node_modules/@patternfly/react-inline-edit-extension/node_modules/@patternfly/react-styles/css/assets/images'
),
],
use: [
{
loader: 'url-loader',
options: {
limit: 5000,
outputPath: 'images',
name: '[name].[ext]',
}, },
], },
}, ],
{ },
test: /\.(jpg|jpeg|png|gif)$/i,
include: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules/patternfly'),
path.resolve(__dirname, 'node_modules/@patternfly/patternfly/assets/images'),
path.resolve(__dirname, 'node_modules/@patternfly/react-styles/css/assets/images'),
path.resolve(__dirname, 'node_modules/@patternfly/react-core/dist/styles/assets/images'),
path.resolve(
__dirname,
'node_modules/@patternfly/react-core/node_modules/@patternfly/react-styles/css/assets/images'
),
path.resolve(
__dirname,
'node_modules/@patternfly/react-table/node_modules/@patternfly/react-styles/css/assets/images'
),
path.resolve(
__dirname,
'node_modules/@patternfly/react-inline-edit-extension/node_modules/@patternfly/react-styles/css/assets/images'
),
],
use: [
{
loader: 'url-loader',
options: {
limit: 5000,
outputPath: 'images',
name: '[name].[ext]',
},
},
],
},
], ],
}, },
resolve: { resolve: {

View File

@ -2230,10 +2230,17 @@ safe-buffer@5.1.2:
resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass@^1.61.0: sass-loader@^13.3.2:
version "1.63.4" version "13.3.2"
resolved "https://registry.npmjs.org/sass/-/sass-1.63.4.tgz" resolved "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.2.tgz"
integrity sha512-Sx/+weUmK+oiIlI+9sdD0wZHsqpbgQg8wSwSnGBjwb5GwqFhYNwwnI+UWZtLjKvKyFlKkatRK235qQ3mokyPoQ== integrity sha512-CQbKl57kdEv+KDLquhC+gE3pXt74LEAzm+tzywcA0/aHZuub8wTErbjAoNI57rPUWRYRNC5WUnNl8eGJNbDdwg==
dependencies:
neo-async "^2.6.2"
sass@^1.3.0, sass@^1.63.6:
version "1.63.6"
resolved "https://registry.npmjs.org/sass/-/sass-1.63.6.tgz"
integrity sha512-MJuxGMHzaOW7ipp+1KdELtqKbfAWbH7OLIdoSMnVe3EXPMTmxTmlaZDCTsgIpPCs3w99lLo9/zDKkOrJuT5byw==
dependencies: dependencies:
chokidar ">=3.0.0 <4.0.0" chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0" immutable "^4.0.0"
@ -2466,6 +2473,14 @@ string_decoder@~1.1.1:
dependencies: dependencies:
safe-buffer "~5.1.0" safe-buffer "~5.1.0"
string-replace-loader@^3.0.0:
version "3.1.0"
resolved "https://registry.npmjs.org/string-replace-loader/-/string-replace-loader-3.1.0.tgz"
integrity sha512-5AOMUZeX5HE/ylKDnEa/KKBqvlnFmRZudSOjVJHxhoJg9QYTwl1rECx7SLR8BBH7tfxb4Rp7EM2XVfQFxIhsbQ==
dependencies:
loader-utils "^2.0.0"
schema-utils "^3.0.0"
strip-ansi@^6.0.1: strip-ansi@^6.0.1:
version "6.0.1" version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
@ -2728,10 +2743,10 @@ webpack-sources@^3.2.3:
resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz"
integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==
"webpack@^4.0.0 || ^5.0.0", "webpack@^4.27.0 || ^5.0.0", "webpack@^4.37.0 || ^5.0.0", "webpack@^4.4.0 || ^5.0.0", webpack@^5.0.0, webpack@^5.1.0, webpack@^5.20.0, webpack@^5.87.0, webpack@5.x.x: "webpack@^4.0.0 || ^5.0.0", "webpack@^4.27.0 || ^5.0.0", "webpack@^4.37.0 || ^5.0.0", "webpack@^4.4.0 || ^5.0.0", webpack@^5, webpack@^5.0.0, webpack@^5.1.0, webpack@^5.20.0, webpack@^5.88.0, webpack@5.x.x:
version "5.87.0" version "5.88.0"
resolved "https://registry.npmjs.org/webpack/-/webpack-5.87.0.tgz" resolved "https://registry.npmjs.org/webpack/-/webpack-5.88.0.tgz"
integrity sha512-GOu1tNbQ7p1bDEoFRs2YPcfyGs8xq52yyPBZ3m2VGnXGtV9MxjrkABHm4V9Ia280OefsSLzvbVoXcfLxjKY/Iw== integrity sha512-O3jDhG5e44qIBSi/P6KpcCcH7HD+nYIHVBhdWFxcLOcIGN8zGo5nqF3BjyNCxIh4p1vFdNnreZv2h2KkoAw3lw==
dependencies: dependencies:
"@types/eslint-scope" "^3.7.3" "@types/eslint-scope" "^3.7.3"
"@types/estree" "^1.0.0" "@types/estree" "^1.0.0"