Fix importing errors

This commit is contained in:
Igor Gassmann 2017-12-21 19:09:30 -03:00
parent e103778b8a
commit 3982a56eaa
6 changed files with 14 additions and 16 deletions

View file

@ -1,14 +1,11 @@
import store from 'store';
import { remote } from 'electron';
import path from 'path';
import Path from 'path';
import y18n from 'y18n';
const env = process.env.NODE_ENV || 'production';
const config = {
...import(`./config/${env}`),
};
const i18n = y18n({
directory: path.join(remote.app.getAppPath(), '/../static/locales').replace(/\\/g, '\\\\'),
directory: Path.join(remote.app.getAppPath(), '/../static/locales').replace(/\\/g, '\\\\'),
updateFiles: false,
locale: 'en',
});
@ -16,7 +13,6 @@ const i18n = y18n({
const logs = [];
const app = {
env,
config,
store,
i18n,
logs,
@ -27,15 +23,18 @@ const app = {
// Workaround for https://github.com/electron-userland/electron-webpack/issues/52
if (env !== 'development') {
window.staticResourcesPath = path
.join(remote.app.getAppPath(), '../static')
.replace(/\\/g, '\\\\');
window.staticResourcesPath = Path.join(remote.app.getAppPath(), '../static').replace(
/\\/g,
'\\\\'
);
} else {
window.staticResourcesPath = '';
}
// eslint-disable-next-line no-underscore-dangle
window.__ = i18n.__;
global.__ = i18n.__;
// eslint-disable-next-line no-underscore-dangle
window.__n = i18n.__n;
window.app = app;
global.__n = i18n.__n;
global.app = app;
export default app;

View file

@ -1 +0,0 @@
module.exports = {};

View file

@ -1 +0,0 @@
module.exports = {};

View file

@ -14,6 +14,7 @@ import amplitude from 'amplitude-js';
import lbry from 'lbry';
import 'scss/all.scss';
import { ipcRenderer, remote, shell } from 'electron';
import app from './app';
const { contextMenu } = remote.require('./main.js');

View file

@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import ReactModal from 'react-modal';
import Link from 'component/link/index';
import app from 'app.js';
import app from 'app';
export class Modal extends React.PureComponent {
static propTypes = {

View file

@ -5085,7 +5085,7 @@ keypress@0.1.x:
version "0.1.0"
resolved "https://registry.yarnpkg.com/keypress/-/keypress-0.1.0.tgz#4a3188d4291b66b4f65edb99f806aa9ae293592a"
keytar@^4.1.0:
keytar@^4.0.3:
version "4.1.0"
resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.1.0.tgz#9e3933e489d656de1a868e1293709313044989d7"
dependencies: