Stop using dist directory to build

This commit is contained in:
Yuya Ochiai 2017-03-03 23:06:47 +09:00
parent 8376ffe4cc
commit ae1c079b95
8 changed files with 14 additions and 13 deletions

2
.gitignore vendored
View file

@ -3,7 +3,7 @@ Thumbs.db
*.log
node_modules/
dist/
*_bundle.js
release/
npm-debug.log*

View file

@ -22,8 +22,7 @@
"build": "npm-run-all build:*",
"build:main": "cross-env NODE_ENV=production webpack --bail --config webpack.config.main.js",
"build:renderer": "cross-env NODE_ENV=production webpack --bail --config webpack.config.renderer.js",
"build:others": "gulp build",
"start": "electron dist",
"start": "electron src",
"watch": "gulp watch",
"serve": "gulp watch",
"test": "npm-run-all build test:* lint:*",

View file

@ -1,6 +1,6 @@
const React = require('react');
const {findDOMNode} = require('react-dom');
const {ipcRenderer, shell} = require('electron');
const {ipcRenderer, remote, shell} = require('electron');
const fs = require('fs');
const url = require('url');
const osLocale = require('os-locale');
@ -8,6 +8,8 @@ const electronContextMenu = require('electron-context-menu');
const ErrorView = require('./ErrorView.jsx');
const preloadJS = `file://${remote.app.getAppPath()}/browser/webview/mattermost_bundle.js`;
const MattermostView = React.createClass({
propTypes: {
disablewebsecurity: React.PropTypes.bool,
@ -228,7 +230,7 @@ const MattermostView = React.createClass({
id={this.props.id}
className='mattermostView'
style={this.props.style}
preload='webview/mattermost.js'
preload={preloadJS}
src={this.props.src}
ref='webview'
nodeintegration='false'

View file

@ -3,13 +3,13 @@
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="modules/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div id="content"></div>
<script src="index.js"></script>
<script src="index_bundle.js"></script>
</body>
</html>

View file

@ -4,14 +4,14 @@
<head>
<meta charset="UTF-8">
<title>Settings</title>
<link rel="stylesheet" href="modules/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/settings.css">
</head>
<body>
<div id="content"></div>
<script src="settings.js"></script>
<script src="settings_bundle.js"></script>
</body>
</html>

View file

@ -4,7 +4,7 @@
"desktopName": "Mattermost.desktop",
"version": "3.6.0",
"description": "Mattermost",
"main": "main.js",
"main": "main_bundle.js",
"author": {
"name": "Yuya Ochiai",
"email": "yuya0321@gmail.com"

View file

@ -6,7 +6,7 @@ const base = require('./webpack.config.base');
module.exports = merge(base, {
entry: './src/main.js',
output: {
filename: './dist/main.js'
filename: './src/[name]_bundle.js'
},
node: {
__filename: false,

View file

@ -10,8 +10,8 @@ module.exports = merge(base, {
'webview/mattermost': './src/browser/webview/mattermost.js'
},
output: {
path: './dist/browser',
filename: '[name].js'
path: './src/browser',
filename: '[name]_bundle.js'
},
module: {
rules: [{