AlexWang

Commit Initial - UMD

# exclude all
/*
# project structure
!/src/
!/etc/
!/doc/
!/test/
!/dist/
# project files
!.gitignore
!README.md
!package.json
!LICENSE
!webpack.config.umd.js
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>UMD PLAYGROUND</title>
</head>
<body>
<div id="stage"></div>
</body>
</html>
... ...
{
"name": "share",
"version": "1.0.0",
"description": "A UMD Web Module.",
"main": "dist/main.js",
"directories": {
"doc": "doc",
"test": "test"
},
"scripts": {
"test": "test/index.js"
},
"keywords": [
"share"
],
"author": "AlexWang",
"license": "MIT",
"dependencies": {},
"wbp": {
"project": "umd",
"entries": {
"main": "./src/main.js",
"test": "./test/test.js"
},
"source": "src/",
"build": "dist/"
}
}
\ No newline at end of file
... ...
// //////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016-present All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// http://www.apache.org/licenses/LICENSE-2.0
//
// Github Home: https://github.com/AlexWang1987
// Author: AlexWang
// Date: 2017-03-17 11:13:14
// QQ Email: 1669499355@qq.com
// Last Modified time: 2017-03-17 11:13:36
// Description: wbp-init-umd-main
//
// //////////////////////////////////////////////////////////////////////////////
// only for hot reload
if (module && module.hot) {
module.hot.accept();
}
... ...
// //////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016-present All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// http://www.apache.org/licenses/LICENSE-2.0
//
// Github Home: https://github.com/AlexWang1987
// Author: AlexWang
// Date: 2017-03-17 11:13:11
// QQ Email: 1669499355@qq.com
// Last Modified time: 2017-03-17 11:13:45
// Description: wbp-init-umd-test
//
// //////////////////////////////////////////////////////////////////////////////
// only for hot reload
if (module && module.hot) {
module.hot.accept();
}
... ...
module.exports = function (umdConf) {
umdConf.devServer.host = '0.0.0.0';
umdConf.output.publicPath = '';
umdConf.webpackFeatures.enableEntryHTML();
umdConf.webpackFeatures.enableEntryHTML('test');
if (umdConf.devMode) {
umdConf.webpackFeatures.enableEntryHot('main');
umdConf.webpackFeatures.enableEntryHot('test');
} else {
umdConf.webpackFeatures.enableUglifyJs({
comments: false
});
}
};
... ...