正在显示
7 个修改的文件
包含
113 行增加
和
0 行删除
.gitignore
0 → 100644
README.md
0 → 100644
etc/umd.template.html
0 → 100644
package.json
0 → 100644
| 1 | +{ | ||
| 2 | + "name": "share", | ||
| 3 | + "version": "1.0.0", | ||
| 4 | + "description": "A UMD Web Module.", | ||
| 5 | + "main": "dist/main.js", | ||
| 6 | + "directories": { | ||
| 7 | + "doc": "doc", | ||
| 8 | + "test": "test" | ||
| 9 | + }, | ||
| 10 | + "scripts": { | ||
| 11 | + "test": "test/index.js" | ||
| 12 | + }, | ||
| 13 | + "keywords": [ | ||
| 14 | + "share" | ||
| 15 | + ], | ||
| 16 | + "author": "AlexWang", | ||
| 17 | + "license": "MIT", | ||
| 18 | + "dependencies": {}, | ||
| 19 | + "wbp": { | ||
| 20 | + "project": "umd", | ||
| 21 | + "entries": { | ||
| 22 | + "main": "./src/main.js", | ||
| 23 | + "test": "./test/test.js" | ||
| 24 | + }, | ||
| 25 | + "source": "src/", | ||
| 26 | + "build": "dist/" | ||
| 27 | + } | ||
| 28 | +} |
src/main.js
0 → 100644
| 1 | +// ////////////////////////////////////////////////////////////////////////////// | ||
| 2 | +// | ||
| 3 | +// Copyright (C) 2016-present All Rights Reserved. | ||
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | +// http://www.apache.org/licenses/LICENSE-2.0 | ||
| 6 | +// | ||
| 7 | +// Github Home: https://github.com/AlexWang1987 | ||
| 8 | +// Author: AlexWang | ||
| 9 | +// Date: 2017-03-17 11:13:14 | ||
| 10 | +// QQ Email: 1669499355@qq.com | ||
| 11 | +// Last Modified time: 2017-03-17 11:13:36 | ||
| 12 | +// Description: wbp-init-umd-main | ||
| 13 | +// | ||
| 14 | +// ////////////////////////////////////////////////////////////////////////////// | ||
| 15 | + | ||
| 16 | +// only for hot reload | ||
| 17 | +if (module && module.hot) { | ||
| 18 | + module.hot.accept(); | ||
| 19 | +} | ||
| 20 | + |
test/test.js
0 → 100644
| 1 | +// ////////////////////////////////////////////////////////////////////////////// | ||
| 2 | +// | ||
| 3 | +// Copyright (C) 2016-present All Rights Reserved. | ||
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | +// http://www.apache.org/licenses/LICENSE-2.0 | ||
| 6 | +// | ||
| 7 | +// Github Home: https://github.com/AlexWang1987 | ||
| 8 | +// Author: AlexWang | ||
| 9 | +// Date: 2017-03-17 11:13:11 | ||
| 10 | +// QQ Email: 1669499355@qq.com | ||
| 11 | +// Last Modified time: 2017-03-17 11:13:45 | ||
| 12 | +// Description: wbp-init-umd-test | ||
| 13 | +// | ||
| 14 | +// ////////////////////////////////////////////////////////////////////////////// | ||
| 15 | + | ||
| 16 | +// only for hot reload | ||
| 17 | +if (module && module.hot) { | ||
| 18 | + module.hot.accept(); | ||
| 19 | +} | ||
| 20 | + |
webpack.config.umd.js
0 → 100644
| 1 | +module.exports = function (umdConf) { | ||
| 2 | + umdConf.devServer.host = '0.0.0.0'; | ||
| 3 | + umdConf.output.publicPath = ''; | ||
| 4 | + | ||
| 5 | + umdConf.webpackFeatures.enableEntryHTML(); | ||
| 6 | + umdConf.webpackFeatures.enableEntryHTML('test'); | ||
| 7 | + | ||
| 8 | + if (umdConf.devMode) { | ||
| 9 | + umdConf.webpackFeatures.enableEntryHot('main'); | ||
| 10 | + umdConf.webpackFeatures.enableEntryHot('test'); | ||
| 11 | + } else { | ||
| 12 | + umdConf.webpackFeatures.enableUglifyJs({ | ||
| 13 | + comments: false | ||
| 14 | + }); | ||
| 15 | + } | ||
| 16 | +}; | ||
| 17 | + |
-
请 注册 或 登录 后发表评论