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 store from 'store';
import { remote } from 'electron'; import { remote } from 'electron';
import path from 'path'; import Path from 'path';
import y18n from 'y18n'; import y18n from 'y18n';
const env = process.env.NODE_ENV || 'production'; const env = process.env.NODE_ENV || 'production';
const config = {
...import(`./config/${env}`),
};
const i18n = y18n({ 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, updateFiles: false,
locale: 'en', locale: 'en',
}); });
@ -16,7 +13,6 @@ const i18n = y18n({
const logs = []; const logs = [];
const app = { const app = {
env, env,
config,
store, store,
i18n, i18n,
logs, logs,
@ -27,15 +23,18 @@ const app = {
// Workaround for https://github.com/electron-userland/electron-webpack/issues/52 // Workaround for https://github.com/electron-userland/electron-webpack/issues/52
if (env !== 'development') { if (env !== 'development') {
window.staticResourcesPath = path window.staticResourcesPath = Path.join(remote.app.getAppPath(), '../static').replace(
.join(remote.app.getAppPath(), '../static') /\\/g,
.replace(/\\/g, '\\\\'); '\\\\'
);
} else { } else {
window.staticResourcesPath = ''; window.staticResourcesPath = '';
} }
// eslint-disable-next-line no-underscore-dangle // eslint-disable-next-line no-underscore-dangle
window.__ = i18n.__; global.__ = i18n.__;
// eslint-disable-next-line no-underscore-dangle // eslint-disable-next-line no-underscore-dangle
window.__n = i18n.__n; global.__n = i18n.__n;
window.app = app; 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 lbry from 'lbry';
import 'scss/all.scss'; import 'scss/all.scss';
import { ipcRenderer, remote, shell } from 'electron'; import { ipcRenderer, remote, shell } from 'electron';
import app from './app';
const { contextMenu } = remote.require('./main.js'); const { contextMenu } = remote.require('./main.js');

View file

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

View file

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