Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Nov 16, 2018
1 parent ffe3b8f commit fb6e9ef
Showing 10 changed files with 162 additions and 191 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@
"update-deps": "lerna exec -- npm-check-updates -a"
},
"devDependencies": {
"@types/dotenv": "^6.1.0",
"@types/electron-devtools-installer": "^2.2.0",
"@types/jest": "^23.3.1",
"@types/memory-fs": "^0.3.1",
2 changes: 1 addition & 1 deletion packages/electron-webpack-eslint/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"repository": "electron-userland/electron-webpack",
"dependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint": "^5.9.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.1"
}
4 changes: 2 additions & 2 deletions packages/electron-webpack-js/package.json
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@
"files": [],
"repository": "electron-userland/electron-webpack",
"dependencies": {
"@babel/core": "^7.1.2",
"@babel/core": "^7.1.6",
"babel-loader": "^8.0.4",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-env": "^7.1.6",
"babel-plugin-component": "^1.1.1"
}
}
2 changes: 1 addition & 1 deletion packages/electron-webpack-ts/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"files": [],
"repository": "electron-userland/electron-webpack",
"dependencies": {
"fork-ts-checker-webpack-plugin": "^0.4.14",
"fork-ts-checker-webpack-plugin": "^0.4.15",
"ts-loader": "^5.3.0"
},
"peerDependencies": {
2 changes: 1 addition & 1 deletion packages/electron-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-webpack",
"version": "2.4.0",
"version": "2.6.0",
"license": "MIT",
"author": "Vladimir Krivosheev <develar@gmail.com>",
"main": "out/main.js",
4 changes: 2 additions & 2 deletions packages/electron-webpack/src/dev/WebpackDevServerManager.ts
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ import { LineFilter, logError, logProcess, logProcessErrorOutput } from "./devUt
const debug = require("debug")("electron-webpack")

function runWds(projectDir: string, env: any) {
const isWin = process.platform === "win32";
const webpackDevServerPath = require.resolve(path.join(".bin", "webpack-dev-server" + (isWin ? ".cmd" : "")));
const isWin = process.platform === "win32"
const webpackDevServerPath = require.resolve(path.join(".bin", "webpack-dev-server" + (isWin ? ".cmd" : "")))
debug(`Start renderer WDS ${webpackDevServerPath} on ${env.ELECTRON_WEBPACK_WDS_PORT} port`)
return run(webpackDevServerPath, ["--color", "--env.autoClean=false", "--config", path.join(__dirname, "../../webpack.renderer.config.js")], {
env,
7 changes: 4 additions & 3 deletions packages/electron-webpack/src/electron-builder.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ interface Context {

export default async function(context: Context) {
const electronWebpackConfig = await getElectronWebpackConfiguration(context)
const distDir = electronWebpackConfig.commonDistDirectory!!
return {
extraMetadata: {
main: "main.js"
@@ -18,13 +19,13 @@ export default async function(context: Context) {
filter: ["package.json"]
},
{
from: `${electronWebpackConfig.commonDistDirectory}/main`
from: `${distDir}/main`
},
{
from: `${electronWebpackConfig.commonDistDirectory}/renderer`
from: `${distDir}/renderer`
},
{
from: `${electronWebpackConfig.commonDistDirectory}/renderer-dll`
from: `${distDir}/renderer-dll`
}
],
extraResources: [
38 changes: 19 additions & 19 deletions packages/electron-webpack/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import BluebirdPromise from "bluebird-lst"
import { readJson, pathExists } from "fs-extra-p"
import { config as dotEnvConfig } from "dotenv"
import { pathExists, readJson } from "fs-extra-p"
import { Lazy } from "lazy-val"
import * as path from "path"
import { validateConfig } from "read-config-file"
@@ -334,26 +335,25 @@ export async function configure(type: ConfigurationType, env: ConfigurationEnv |
if (sourceDir === null) {
return null
}
else {
const processEnv = configurator.isProduction ? "production" : "development"
const dotEnvPath = path.resolve(configurator.projectDir, ".env")
const dotenvFiles = [
`${dotEnvPath}.${processEnv}.local`,
`${dotEnvPath}.${processEnv}`,
`${dotEnvPath}.local`,
dotEnvPath,
]

for (const file of dotenvFiles) {
const exists = await pathExists(file)
if (exists) {
require("dotenv").config({
path: file
})
}

const processEnv = configurator.isProduction ? "production" : "development"
const dotEnvPath = path.resolve(configurator.projectDir, ".env")
const dotenvFiles = [
`${dotEnvPath}.${processEnv}.local`,
`${dotEnvPath}.${processEnv}`,
`${dotEnvPath}.local`,
dotEnvPath,
]

for (const file of dotenvFiles) {
const exists = await pathExists(file)
if (exists) {
dotEnvConfig({
path: file
})
}
return await configurator.configure()
}
return await configurator.configure()
}

async function computeEntryFile(srcDir: string, projectDir: string): Promise<string | null> {
Loading

0 comments on commit fb6e9ef

Please sign in to comment.