forked from cockpit-project/cockpit-podman
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO: [ ] cockpit-po-plugin [ ] fail on warnings eslint (Open eslint issue eslint/eslint#16804)
- Loading branch information
Showing
7 changed files
with
75 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const esbuild = require("esbuild"); | ||
const path = require("path"); | ||
const eslint = require('esbuild-plugin-linter'); | ||
const {sassPlugin } = require('esbuild-sass-plugin') | ||
const { nodeExternalsPlugin } = require('esbuild-node-externals'); | ||
const replacePlugin = require('esbuild-plugin-replace-regex'); | ||
|
||
const production = process.env.NODE_ENV === 'production'; | ||
/* development options for faster iteration */ | ||
const useEslint = process.env.ESLINT !== '0'; | ||
const watchMode = process.env.ESBUILD_WATCH === "true" || false; | ||
if(watchMode) { | ||
console.log("Running in watch mode"); | ||
} | ||
|
||
nodePaths=["node_modules", path.resolve(__dirname, 'pkg/lib')] | ||
|
||
esbuild.build({ | ||
// Cockpit's http server is not able to load multiple JS files | ||
bundle: true, | ||
entryPoints: ["./src/index.js"], | ||
// Allow external font files which live in ../../static/fonts | ||
external: ['*.woff', '*.woff2'], | ||
// Move all legal comments to a .LEGAL.txt file | ||
legalComments: 'external', | ||
loader: { ".js": "jsx" }, | ||
minify: production, | ||
// List of directories to use when resolving import statements | ||
nodePaths, | ||
outdir: "./dist", | ||
... !production ? { sourcemap: "external" } : {}, | ||
target: ['es2020'], | ||
watch: watchMode, | ||
plugins: [ | ||
sassPlugin({ | ||
loadPaths: nodePaths, quietDeps: true | ||
}), | ||
... useEslint ? [eslint({ filter: /src\/*/ })] : [], | ||
nodeExternalsPlugin(), | ||
replacePlugin({ | ||
filter: /patternfly-4-cockpit.scss$/, | ||
patterns: [ | ||
[/@font-face[^}]*patternfly-fonts-fake-path[^}]*}/g, ''], | ||
[/src:url\("patternfly-icons-fake-path\/pficon[^}]*/g, 'src:url("../base1/fonts/patternfly.woff") format("woff");'], | ||
] | ||
}), | ||
] | ||
}).catch(() => process.exit(1)); |
Submodule node_modules
updated
6365 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.