Commit c9aaf2a3 authored by Antoor's avatar Antoor

Remove webpack dependence, direct execution ES6

删除webpack依赖,直接执行ES6
parent b98778a9
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
## 2016/04 ## 2016/04
### /25
1. 移除`webpack`以及其他不必要的依赖,直接无需编译即可执行ES6代码(有新模块`babel`的加入,请使用`npm install`初始化
### /24 `(v1.2.1)` ### /24 `(v1.2.1)`
1. 重写前端资源加载方案 1. 重写前端资源加载方案
2. 优化部分ES6代码 2. 优化部分ES6代码
......
{ {
"name": "antsword", "name": "antsword",
"version": "1.2.1", "version": "1.3.0",
"description": "中国蚁剑是一款跨平台的开源网站管理工具", "description": "中国蚁剑是一款跨平台的开源网站管理工具",
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"babel-core": "^6.7.2", "babel": "^5.2.17",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"electron-prebuilt": "^0.37.2", "electron-prebuilt": "^0.37.2",
"extract-zip": "^1.5.0", "extract-zip": "^1.5.0",
"iconv-lite": "^0.4.13", "iconv-lite": "^0.4.13",
...@@ -17,12 +14,11 @@ ...@@ -17,12 +14,11 @@
"nugget": "^2.0.0", "nugget": "^2.0.0",
"superagent": "^1.6.1", "superagent": "^1.6.1",
"superagent-proxy": "^1.0.0", "superagent-proxy": "^1.0.0",
"through": "^2.3.8", "through": "^2.3.8"
"webpack": "^1.12.14"
}, },
"scripts": { "scripts": {
"start": "electron app.js", "start": "electron app.js",
"build": "webpack --progress --color --watch" "build": "npm start"
}, },
"author": "antoor <u@uyu.us>", "author": "antoor <u@uyu.us>",
"license": "MIT", "license": "MIT",
...@@ -32,12 +28,9 @@ ...@@ -32,12 +28,9 @@
}, },
"debug": true, "debug": true,
"update": { "update": {
"md5": "1d21b4f1fb4ddc9a8014020a37b96777", "md5": "",
"logs": "修补 aspx 连接和文件管理的 Bug\n新添加了 aspx base64 编码器\n更新美化关于页面\n修正 Aspx 中代码根据用户配置自动编码\n重写前端资源加载方案\n优化部分ES6代码", "logs": "",
"sources": { "sources": {}
"coding.net": "https://coding.net/api/share/download/4aaf3221-af66-4f63-824d-37b81bc68711",
"github": "https://github.com/antoor/antSword/releases/download/1.2.1/update.zip"
}
}, },
"bugs": { "bugs": {
"url": "https://github.com/antoor/antSword/issues" "url": "https://github.com/antoor/antSword/issues"
......
...@@ -96,8 +96,8 @@ antSword['tabbar'] = new dhtmlXTabBar(document.body); ...@@ -96,8 +96,8 @@ antSword['tabbar'] = new dhtmlXTabBar(document.body);
'settings', 'settings',
'plugin' 'plugin'
].map((_) => { ].map((_) => {
let _module = require(`./modules/${_}/index`); let _module = require(`./modules/${_}/`);
antSword['modules'][_] = new _module.default(); antSword['modules'][_] = new _module();
}); });
// 移除加载界面&&设置标题 // 移除加载界面&&设置标题
$('#loading').remove(); $('#loading').remove();
......
/**
* 中国蚁剑::前端加载模块
* 开写: 2016/04/23
* 更新: 2016/04/24
* 作者: 蚁逅 <https://github.com/antoor>
*/
'use strict'; 'use strict';
// 加载jQuery // 加载jQuery
...@@ -101,7 +108,7 @@ $(document).ready(() => { ...@@ -101,7 +108,7 @@ $(document).ready(() => {
}).then(() => { }).then(() => {
return loadJS('../static/libs/terminal/js/jquery.terminal-src.js'); return loadJS('../static/libs/terminal/js/jquery.terminal-src.js');
}).then(() => { }).then(() => {
return loadJS('../static/libs/dhtmlx/codebase/dhtmlx_pro.js'); return loadJS('../static/libs/dhtmlx/codebase/dhtmlx.js');
}).then(() => { }).then(() => {
/** /**
* 配置layer弹出层 * 配置layer弹出层
...@@ -109,7 +116,9 @@ $(document).ready(() => { ...@@ -109,7 +116,9 @@ $(document).ready(() => {
* @return {[type]} [description] * @return {[type]} [description]
*/ */
layer.config({extend: 'extend/layer.ext.js'}); layer.config({extend: 'extend/layer.ext.js'});
// 加载babel引擎
require('babel/register')();
// 加载程序入口 // 加载程序入口
return loadJS('../static/build/app.bundle.js'); require('./app.entry.jsx');
}); });
}); });
This diff is collapsed.
This diff is collapsed.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"/> <meta charset="utf-8"/>
<title>AntSword</title> <title>AntSword</title>
<link rel="stylesheet" href="../static/css/index.css"/> <link rel="stylesheet" href="../static/css/index.css"/>
<script src="../static/build/load.bundle.js"></script> <script>require('../source/load.entry.jsx');</script>
</head> </head>
<body> <body>
<div id="loading"></div> <div id="loading"></div>
......
'use strict';
const webpack = require('webpack');
module.exports = {
entry: {
app: __dirname + '/source/app.entry.jsx',
load: __dirname + '/source/load.entry.jsx'
},
output: {
path: __dirname + '/static/build',
filename: '[name].bundle.js'
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {}
},
module: {
loaders: [
{ test: /\.jsx$/, loader: 'babel', query: { presets: ['es2015', 'stage-0'] }}
]
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment