Stop using __dirname to avoid confusing
This commit is contained in:
parent
3b4a1dfca9
commit
1ab0859ac1
|
@ -100,7 +100,7 @@ const MattermostView = React.createClass({
|
|||
|
||||
osLocale().then((locale) => {
|
||||
if (locale === 'ja_JP') {
|
||||
applyCssFile(__dirname + '/css/jp_fonts.css');
|
||||
applyCssFile(remote.app.getAppPath() + '/css/jp_fonts.css');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ const appLauncher = new AutoLaunch({
|
|||
|
||||
function backToIndex(index) {
|
||||
const target = typeof index === 'undefined' ? 0 : index;
|
||||
const indexURL = remote.getGlobal('isDev') ? 'http://localhost:8080/browser/index.html' : `file://${__dirname}/index.html`;
|
||||
const indexURL = remote.getGlobal('isDev') ? 'http://localhost:8080/browser/index.html' : `file://${remote.app.getAppPath()}/browser/index.html`;
|
||||
remote.getCurrentWindow().loadURL(`${indexURL}?index=${target}`);
|
||||
}
|
||||
|
||||
|
|
|
@ -490,7 +490,7 @@ app.on('ready', () => {
|
|||
}
|
||||
|
||||
// and load the index.html of the app.
|
||||
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : 'file://' + __dirname + '/browser/index.html';
|
||||
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
|
||||
mainWindow.loadURL(indexURL);
|
||||
|
||||
// Set application menu
|
||||
|
|
|
@ -4,7 +4,7 @@ const electron = require('electron');
|
|||
const Menu = electron.Menu;
|
||||
|
||||
function createTemplate(mainWindow, config, isDev) {
|
||||
const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : 'file://' + __dirname + '/browser/settings.html';
|
||||
const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : `file://${electron.app.getAppPath()}/browser/settings.html`;
|
||||
|
||||
const separatorItem = {
|
||||
type: 'separator'
|
||||
|
|
|
@ -6,7 +6,7 @@ const {
|
|||
} = require('electron');
|
||||
|
||||
function createTemplate(mainWindow, config, isDev) {
|
||||
const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : `file://${__dirname}/browser/settings.html`;
|
||||
const settingsURL = isDev ? 'http://localhost:8080/browser/settings.html' : `file://${app.getAppPath()}/browser/settings.html`;
|
||||
var template = [
|
||||
...config.teams.slice(0, 9).map((team, i) => {
|
||||
return {
|
||||
|
|
|
@ -9,8 +9,8 @@ module.exports = merge(base, {
|
|||
filename: './src/[name]_bundle.js'
|
||||
},
|
||||
node: {
|
||||
__filename: false,
|
||||
__dirname: false
|
||||
__filename: true,
|
||||
__dirname: true
|
||||
},
|
||||
target: 'electron-main',
|
||||
externals: {
|
||||
|
|
|
@ -28,8 +28,8 @@ module.exports = merge(base, {
|
|||
}]
|
||||
},
|
||||
node: {
|
||||
__filename: false,
|
||||
__dirname: false
|
||||
__filename: true,
|
||||
__dirname: true
|
||||
},
|
||||
target: 'electron-renderer',
|
||||
devServer: {
|
||||
|
|
Loading…
Reference in a new issue