diff --git a/.eslintrc.js b/.eslintrc.js index 928e6ad..1a41851 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,7 +16,11 @@ module.exports = { ], rules: { 'no-console': 'error', - 'prettier/prettier': 'error', + 'prettier/prettier': [ + 'error', { + 'endOfLine': 'auto' + } + ], // TODO remove when done killing `any`s and making tsc strict '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-explicit-any': 'off', diff --git a/app/src/preload.ts b/app/src/preload.ts index 4e13759..60ac2da 100644 --- a/app/src/preload.ts +++ b/app/src/preload.ts @@ -11,7 +11,19 @@ import * as fs from 'fs'; import * as path from 'path'; import { ipcRenderer } from 'electron'; -import * as log from 'loglevel'; + +// Do *NOT* add 3rd-party imports here in preload (except for webpack `externals` like electron). +// They will work during development, but break in the prod build :-/ . +// Electron doc isn't explicit about that, so maybe *we*'re doing something wrong. +// At any rate, that's what we have now. If you want an import here, go ahead, but +// verify that apps built with a non-devbuild nativefier (installed from tarball) work. +// Recipe to monkey around this, assuming you git-cloned nativefier in /opt/nativefier/ : +// cd /opt/nativefier/ && rm -f nativefier-43.1.0.tgz && npm run build && npm pack && mkdir -p ~/n4310/ && cd ~/n4310/ \ +// && rm -rf ./* && npm i /opt/nativefier/nativefier-43.1.0.tgz && ./node_modules/.bin/nativefier 'google.com' +// See https://github.com/nativefier/nativefier/issues/1175 +// and https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions / preload + +const log = console; // since we can't have `loglevel` here in preload export const INJECT_DIR = path.join(__dirname, '..', 'inject');