Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make nodejs much simpler #596

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ This is simply a measurement of the number of vulnerabilities to the vulnerable

### Working with NodeJS

This plugin used the same project setup as [sonar-custom-plugin-example][]. Checkout this project to get information to work with NodeJS components.
- Start SonarQube Server
- Run `npm start` inside `sonar-dependency-check-plugin`
- Adjust `DEFAULT_PORT`, `PROXY_URL`, `PROXY_CONTEXT_PATH` for your environment

## Distribution

Expand Down
24 changes: 0 additions & 24 deletions sonar-dependency-check-plugin/conf/env.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*
* Copy from https://github.com/SonarSource/sonar-custom-plugin-example/blob/7.x/conf/webpack/webpack.config.js
*
* Copyright (C) 2017-2017 SonarSource SA
* All rights reserved
* mailto:info AT sonarsource DOT com
*/
const path = require("path");

module.exports = {
Expand All @@ -17,7 +10,7 @@ module.exports = {
output: {
// The entry point files MUST be shipped inside the final JAR's static/
// directory.
path: path.join(__dirname, "../../target/classes/static"),
path: path.join(__dirname, "../target/classes/static"),
filename: "[name].js"
},
resolve: {
Expand Down
30 changes: 30 additions & 0 deletions sonar-dependency-check-plugin/conf/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const { merge } = require('webpack-merge');
const common = require("./webpack.common.js");
const webpack = require('webpack');

const PROXY_URL = process.env.PROXY_URL || 'http://localhost:9000';
const PROXY_CONTEXT_PATH = process.env.PROXY_CONTEXT_PATH || ''
const DEFAULT_PORT = process.env.PORT || 3000;


module.exports = merge(common, {
devtool: 'eval',
mode: 'development',
output: {
pathinfo: true,
publicPath: PROXY_CONTEXT_PATH + "/static/dependencycheck/",
},
devServer: {
port: DEFAULT_PORT,
devMiddleware: {
index: false, // specify to enable root proxying
},
proxy: {
context: () => true,
target: PROXY_URL,
secure: false,
changeOrigin: true,
},
},
plugins: [new webpack.HotModuleReplacementPlugin()]
});
12 changes: 12 additions & 0 deletions sonar-dependency-check-plugin/conf/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = merge(common, {

mode: 'production',
// Don't attempt to continue if there are any errors.
bail: true,
optimization: {
minimize: true
},
});
25 changes: 0 additions & 25 deletions sonar-dependency-check-plugin/conf/webpack/webpack.config.dev.js

This file was deleted.

38 changes: 0 additions & 38 deletions sonar-dependency-check-plugin/conf/webpack/webpack.config.prod.js

This file was deleted.

Loading