Skip to content

Commit

Permalink
change build config
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Sep 7, 2017
1 parent 194425b commit be157b0
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 38 deletions.
16 changes: 13 additions & 3 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@

# 1.1.1(2017-09-07)
# 1.1.1

### 2017-09-07

#### Improvements
- 添加文件助手

#### Bug fixed
- 修改样式,防止文字信息内容过长

### 2017-09-07

#### Improvements
- 调整表情框表情大小
Expand All @@ -8,7 +18,7 @@
#### Feature
- 多文件拖拽发送

#### BUg fixed
#### Bug fixed
- 仅在聊天开启时允许文件拖拽
- 修复手机端消息同步客户端错误
- 修复图片加载失败使用错误`src`进行回滚导致客户端卡死的问题
- 修复图片加载失败使用错误`src`进行回滚导致客户端卡死的问题
3 changes: 0 additions & 3 deletions config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ const config = {
client: path.resolve(__dirname, '../src'),
assets: path.resolve(__dirname, '../src/assets'),
dist: path.resolve(__dirname, '../dist'),

/** Bebug namespace */
namespace: 'app:*',
};

export default config;
4 changes: 4 additions & 0 deletions config/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export default {
test: /\.json$/,
loader: 'json-loader',
},
{
test: /\.html/,
loader: 'html-loader',
},
{
test: /\.woff(\?.*)?$/,
loader: 'url-loader?prefix=fonts/&name=[path][name].[ext]&limit=40000&mimetype=application/font-woff',
Expand Down
2 changes: 1 addition & 1 deletion config/webpack.config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {

...baseConfig,

devtool: 'cheap-module-source-map',
devtool: false,

entry: [
'babel-polyfill',
Expand Down
4 changes: 1 addition & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,7 @@ const createMainWindow = () => {

mainWindow.setSize(350, 460);
mainWindow.loadURL(
process.env.NODE_ENV === 'production'
? `file://${__dirname}/src/index.html`
: `file://${__dirname}/src/index.dev.html`
`file://${__dirname}/src/index.html`
);

mainWindow.webContents.on('did-finish-load', () => {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"package-win32": "npm run build && rm -rf release && build --win --ia32 --projectDir ./dist",
"package-linux": "npm run build && rm -rf release && build --linux --projectDir ./dist",
"package-mac": "npm run build && rm -rf release && build --mac --projectDir ./dist",
"package-all": "npm run build && rm -rf release && build --mac --win --linux --projectDir ./dist",
"hot-server": "cross-env NODE_ENV=development node -r babel-register scripts/dev.js",
"start-hot": "cross-env HOT=1 NODE_ENV=development ./node_modules/.bin/electron -r babel-register -r babel-polyfill ./main",
"dev": "concurrently --kill-others \"npm run hot-server\" \"npm run start-hot\""
Expand Down Expand Up @@ -121,6 +122,7 @@
"express": "^4.15.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"html-loader": "^0.5.1",
"html-webpack-plugin": "^2.30.1",
"json-loader": "^0.5.4",
"postcss-autoreset": "^2.0.0",
Expand Down
28 changes: 0 additions & 28 deletions src/index.dev.html

This file was deleted.

11 changes: 11 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,16 @@
</head>
<body>
<div id="root"></div>
<script>
if (process.env.HOT) {
let script = document.createElement('script');
let port = process.env.PORT || 3000;

script.async = '';
script.src = `http://localhost:${port}/dist/bundle.js`;

document.body.appendChild(script);
}
</script>
</body>
</html>

0 comments on commit be157b0

Please sign in to comment.