Skip to content

Commit b55277a

Browse files
committed
Add new build process
1 parent b69523d commit b55277a

File tree

6 files changed

+3818
-61
lines changed

6 files changed

+3818
-61
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ or
1414
yarn add html5-form-validator
1515
```
1616

17+
or
18+
19+
Just download this repository and link the files located in dist folder:
20+
21+
```
22+
<script src="dist/index.min.js"></script>
23+
```
24+
1725
## Usage
1826

1927
```

dist/index.js

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
1+
(function webpackUniversalModuleDefinition(root, factory) {
2+
if(typeof exports === 'object' && typeof module === 'object')
3+
module.exports = factory();
4+
else if(typeof define === 'function' && define.amd)
5+
define([], factory);
6+
else if(typeof exports === 'object')
7+
exports["html5formValidation"] = factory();
8+
else
9+
root["html5formValidation"] = factory();
10+
})(window, function() {
11+
return /******/ (function(modules) { // webpackBootstrap
12+
/******/ // The module cache
13+
/******/ var installedModules = {};
14+
/******/
15+
/******/ // The require function
16+
/******/ function __webpack_require__(moduleId) {
17+
/******/
18+
/******/ // Check if module is in cache
19+
/******/ if(installedModules[moduleId]) {
20+
/******/ return installedModules[moduleId].exports;
21+
/******/ }
22+
/******/ // Create a new module (and put it into the cache)
23+
/******/ var module = installedModules[moduleId] = {
24+
/******/ i: moduleId,
25+
/******/ l: false,
26+
/******/ exports: {}
27+
/******/ };
28+
/******/
29+
/******/ // Execute the module function
30+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31+
/******/
32+
/******/ // Flag the module as loaded
33+
/******/ module.l = true;
34+
/******/
35+
/******/ // Return the exports of the module
36+
/******/ return module.exports;
37+
/******/ }
38+
/******/
39+
/******/
40+
/******/ // expose the modules object (__webpack_modules__)
41+
/******/ __webpack_require__.m = modules;
42+
/******/
43+
/******/ // expose the module cache
44+
/******/ __webpack_require__.c = installedModules;
45+
/******/
46+
/******/ // define getter function for harmony exports
47+
/******/ __webpack_require__.d = function(exports, name, getter) {
48+
/******/ if(!__webpack_require__.o(exports, name)) {
49+
/******/ Object.defineProperty(exports, name, {
50+
/******/ configurable: false,
51+
/******/ enumerable: true,
52+
/******/ get: getter
53+
/******/ });
54+
/******/ }
55+
/******/ };
56+
/******/
57+
/******/ // define __esModule on exports
58+
/******/ __webpack_require__.r = function(exports) {
59+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
60+
/******/ };
61+
/******/
62+
/******/ // getDefaultExport function for compatibility with non-harmony modules
63+
/******/ __webpack_require__.n = function(module) {
64+
/******/ var getter = module && module.__esModule ?
65+
/******/ function getDefault() { return module['default']; } :
66+
/******/ function getModuleExports() { return module; };
67+
/******/ __webpack_require__.d(getter, 'a', getter);
68+
/******/ return getter;
69+
/******/ };
70+
/******/
71+
/******/ // Object.prototype.hasOwnProperty.call
72+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
73+
/******/
74+
/******/ // __webpack_public_path__
75+
/******/ __webpack_require__.p = "";
76+
/******/
77+
/******/
78+
/******/ // Load entry module and return exports
79+
/******/ return __webpack_require__(__webpack_require__.s = 0);
80+
/******/ })
81+
/************************************************************************/
82+
/******/ ([
83+
/* 0 */
84+
/***/ (function(module, exports, __webpack_require__) {
85+
186
"use strict";
287

88+
389
Object.defineProperty(exports, "__esModule", {
490
value: true
591
});
@@ -63,8 +149,8 @@ function () {
63149

64150
try {
65151
for (var _iterator = requiredFields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
66-
var _field = _step.value;
67-
this.validateField(_field);
152+
var field = _step.value;
153+
this.validateField(field);
68154
}
69155
} catch (err) {
70156
_didIteratorError = true;
@@ -106,4 +192,8 @@ function () {
106192
return html5formValidation;
107193
}();
108194

109-
exports.default = html5formValidation;
195+
exports.default = html5formValidation;
196+
197+
/***/ })
198+
/******/ ])["default"];
199+
});

dist/index.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "html5-form-validator",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "The most simple HTML5 form validator",
55
"main": "dist/index.js",
66
"scripts": {
7-
"build": "babel src -d dist"
7+
"build": "webpack"
88
},
99
"repository": {
1010
"type": "git",
@@ -25,6 +25,10 @@
2525
"@babel/cli": "^7.0.0-beta.44",
2626
"@babel/core": "^7.0.0-beta.44",
2727
"@babel/preset-env": "^7.0.0-beta.44",
28-
"@babel/preset-stage-2": "^7.0.0-beta.44"
28+
"@babel/preset-stage-2": "^7.0.0-beta.44",
29+
"babel-loader": "^8.0.0-beta",
30+
"unminified-webpack-plugin": "^2.0.0",
31+
"webpack": "^4.5.0",
32+
"webpack-cli": "^2.0.14"
2933
}
3034
}

webpack.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
2+
3+
module.exports = {
4+
mode: 'production',
5+
entry: './src/index.js',
6+
output: {
7+
filename: 'index.min.js',
8+
library: 'html5formValidation',
9+
libraryTarget: 'umd',
10+
libraryExport: 'default'
11+
},
12+
module: {
13+
rules: [
14+
{
15+
test: /\.(js)$/,
16+
loader: 'babel-loader'
17+
}
18+
]
19+
},
20+
plugins: [new UnminifiedWebpackPlugin()]
21+
};

0 commit comments

Comments
 (0)