Skip to content

Commit

Permalink
Fix main package build
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Oct 18, 2023
1 parent f49db74 commit 20996b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Nuclear main process",
"scripts": {
"start": "shx rm -rf build && webpack --env NODE_ENV=development && electron build/main.js --inspect=9001",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 webpack --env NODE_ENV=production",
"build": "cross-env NODE_OPTIONS=--max-old-space-size=8192 webpack --progress --env NODE_ENV=production",
"lint": "eslint src/**/**.ts",
"lint:fix": "eslint src/**/**.ts --fix",
"test": "jest --silent"
Expand Down Expand Up @@ -95,4 +95,4 @@
"mpris-service": "2.1.0",
"x11": "^2.3.0"
}
}
}
10 changes: 6 additions & 4 deletions packages/main/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const osMapper: Record<string, BuildEnv['TARGET']> = {
};

const MAIN_DIR = path.resolve(__dirname, 'src');
const CORE_DIR = path.resolve(__dirname, '..', 'core', 'src');
const CORE_DIR_SYMLINKED = path.resolve(__dirname, 'node_modules', '@nuclear', 'core', 'src');
const CORE_DIR = path.resolve(__dirname, '..', '..', 'node_modules', '@nuclear', 'core', 'src');

module.exports = (env: BuildEnv): webpack.Configuration => {
if (!env.TARGET) {
Expand Down Expand Up @@ -52,9 +51,12 @@ module.exports = (env: BuildEnv): webpack.Configuration => {
module: {
rules: [
{
test: /.ts?$/,
test: /\.ts?$/,
loader: 'ts-loader',
include: [MAIN_DIR, CORE_DIR, CORE_DIR_SYMLINKED]
include: [MAIN_DIR, CORE_DIR],
options: {
allowTsInNodeModules: true
}
},
{
test: /\.node$/,
Expand Down

0 comments on commit 20996b1

Please sign in to comment.