install electron-forge

This commit is contained in:
Xymorot 2019-06-08 02:18:50 +02:00
parent e6ffde7b5e
commit 1b345af4ca
7 changed files with 6613 additions and 92 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ node_modules
# generated code
dist
.webpack

6611
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,22 +4,47 @@
"description": ".",
"private": true,
"author": "Xymorot",
"main": "./.webpack/main",
"scripts": {
"start": "electron ./dist/main.js",
"start": "electron-forge start",
"build": "tsc",
"watch": "tsc -w",
"tslint-check": "tslint-config-prettier-check ./tslint.json",
"tslint": "tslint -t stylish -c tslint.json -p tsconfig.json",
"prettier": "prettier -c **/*.{html,{c,sc,sa,le}ss,yml}"
},
"dependencies": {
"electron": "^2.0.18",
"typescript": "^2.9.2"
},
"dependencies": {},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.39",
"@electron-forge/plugin-webpack": "^6.0.0-beta.39",
"@marshallofsound/webpack-asset-relocator-loader": "^0.5.0",
"electron": "^2.0.18",
"prettier": "^1.18.2",
"tslint": "^5.17.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1"
"tslint-plugin-prettier": "^2.0.1",
"typescript": "^2.9.2"
},
"config": {
"forge": {
"plugins": [
[
"@electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./index.html",
"js": "./dist/renderer.js",
"name": "main_window"
}
]
}
}
]
]
}
}
}

View File

@ -4,10 +4,8 @@
"rules": {
"prettier": true,
"no-console": true,
"object-literal-sort-keys": [
true,
"match-declaration-order-only"
]
"object-literal-sort-keys": [true, "match-declaration-order-only"],
"no-implicit-dependencies": [true, "dev"]
},
"linterOptions": {
"exclude": ["node_modules", "dist"]

11
webpack.main.config.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './dist/main.js',
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
};

View File

@ -0,0 +1,6 @@
module.exports = {
// Put your normal webpack config below here
module: {
rules: require('./webpack.rules'),
},
};

33
webpack.rules.js Normal file
View File

@ -0,0 +1,33 @@
module.exports = [
// Add support for native node modules
{
test: /\.node$/,
use: 'node-loader',
},
{
test: /\.(m?js|node)$/,
parser: { amd: false },
use: {
loader: '@marshallofsound/webpack-asset-relocator-loader',
options: {
outputAssetBase: 'native_modules',
},
},
},
// Put your webpack loader rules in this array. This is where you would put
// your ts-loader configuration for instance:
/**
* Typescript Example:
*
* {
* test: /\.tsx?$/,
* exclude: /(node_modules|.webpack)/,
* loaders: [{
* loader: 'ts-loader',
* options: {
* transpileOnly: true
* }
* }]
* }
*/
];