Skip to content

Commit fc3cb87

Browse files
committed
Node loader fix attempt
Signed-off-by: Omkar Phansopkar <[email protected]>
1 parent 2f44606 commit fc3cb87

File tree

7 files changed

+16
-26
lines changed

7 files changed

+16
-26
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"homepage": "",
2020
"main": ".webpack/main",
2121
"scripts": {
22-
"start": "ELECTRON_IS_DEV=1 electron-forge start",
22+
"start": "electron-forge start",
2323
"postinstall": "electron-builder install-app-deps",
2424
"publish": "electron-forge package && node packager.js && npm run create-archive",
2525
"create-archive": "python archive_builder.py",
@@ -81,7 +81,6 @@
8181
"allotment": "^1.17.0",
8282
"bootstrap": "^5.2.1",
8383
"c3": "^0.7.20",
84-
"electron-is-dev": "^2.0.0",
8584
"electron-packager": "^16.0.0",
8685
"electron-squirrel-startup": "^1.0.0",
8786
"file-loader": "^6.2.0",

src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ import FileInfoDash from './pages/FileInfoDash/FileInfoDash';
1818
import LicenseInfoDash from './pages/LicenseInfoDash/LicenseInfoDash';
1919
import PackageInfoDash from './pages/PackageInfoDash/PackageInfoDash';
2020
import Packages from './pages/Packages/Packages';
21+
import LicenseDetections from './pages/LicenseDetections/LicenseDetections';
2122
import ChartView from './pages/ChartView/ChartView';
2223
import ScanInfo from './pages/ScanInfo/ScanInfo';
2324
import About from './pages/About/About';
2425
import PageNotFound from './pages/PageNotFound';
2526

27+
import './utils/ensureRendererDeps';
28+
2629
import './fontawesome';
2730
import 'rc-tree/assets/index.css';
2831
import 'react-toastify/dist/ReactToastify.css';
@@ -32,7 +35,6 @@ import 'react-tooltip/dist/react-tooltip.css'
3235
import './app.css';
3336
import './dashStyles.css';
3437
import './customFaColors.css';
35-
import LicenseDetections from './pages/LicenseDetections/LicenseDetections';
3638

3739
const App = () => {
3840
return (

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import sqlite3 from 'sqlite3'
2-
import isDev from 'electron-is-dev';
32
import { app, BrowserWindow, nativeImage, ipcMain, Menu, shell } from 'electron';
43

54
import getTemplate from './mainMenu';
@@ -9,8 +8,9 @@ import { setUpGlobalIpcListeners, setUpWindowListeners } from './mainActions';
98
// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on
109
// whether you're running in development or production).
1110
declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
11+
const isDev = !app.isPackaged;
1212

13-
console.log("Sqlit3:", sqlite3);
13+
console.log("Using Sqlite3 ", sqlite3.VERSION);
1414

1515
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
1616
if (require('electron-squirrel-startup')) {

src/pages/Home/Home.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import ProgressLoader from '../../components/ProgressLoader/ProgressLoader'
1616
import { OPEN_DIALOG_CHANNEL } from '../../constants/IpcConnection';
1717
import { GetHistory, HistoryItem, RemoveEntry } from '../../services/historyStore'
1818

19-
import '../../utils/ensureRendererDeps';
2019
import './home.css'
2120

2221
const { ipcRenderer } = electron;

src/services/workbenchDB.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import { FileAttributes } from "./models/file";
4545
import { flattenFile } from "./models/flatFile";
4646
import { UNKNOWN_EXPRESSION, UNKNOWN_EXPRESSION_SPDX } from "../constants/data";
4747

48-
4948
/**
5049
* Manages the database created from a ScanCode JSON input.
5150
* The database contains tables for both flattened and unflattened data

webpack.rules.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module.exports = [
22
// Add support for native node modules
3-
{
4-
// We're specifying native_modules in the test because the asset relocator loader generates a
5-
// "fake" .node file which is really a cjs file.
6-
test: /native_modules\/.+\.node$/,
7-
use: 'node-loader',
8-
},
9-
{
10-
test: /\.node$/,
11-
loader: "node-loader",
12-
},
3+
// {
4+
// // We're specifying native_modules in the test because the asset relocator loader generates a
5+
// // "fake" .node file which is really a cjs file.
6+
// test: /native_modules\/.+\.node$/,
7+
// use: 'node-loader',
8+
// },
9+
// {
10+
// test: /\.node$/,
11+
// loader: "node-loader",
12+
// },
1313
{
1414
test: /\.(png|jpg|jpeg|eps|gif)$/i,
1515
use: [

0 commit comments

Comments
 (0)