AlexWang

Commit Initial - UMD

  1 +# exclude all
  2 +/*
  3 +
  4 +# project structure
  5 +!/src/
  6 +!/etc/
  7 +!/doc/
  8 +!/test/
  9 +!/dist/
  10 +
  11 +# project files
  12 +!.gitignore
  13 +!README.md
  14 +!package.json
  15 +!LICENSE
  16 +!webpack.config.umd.js
  1 +<!DOCTYPE html>
  2 +<html>
  3 +<head>
  4 + <meta charset="UTF-8">
  5 + <title>UMD PLAYGROUND</title>
  6 +</head>
  7 +
  8 +<body>
  9 + <div id="stage"></div>
  10 +</body>
  11 +
  12 +</html>
  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 +}
  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 +
  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 +
  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 +