Skip to content

Commit

Permalink
Add new build process
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptex committed Apr 16, 2018
1 parent 9235451 commit 50b850e
Show file tree
Hide file tree
Showing 6 changed files with 4,242 additions and 515 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ Import each function separately.

See functions list below.

or

Just download this repository and link the files located in dist folder:

```
<script src="dist/index.min.js"></script>
```

## Functions

* `byID` - retrieves an element by ID
* `single` - retrieves an element by a given valid css selector
* `multi` - retrieves a collection of elements and normalizes the return value
* `addListener` - attaches an event listener to element
* `byID` - retrieves an element by ID
* `single` - retrieves an element by a given valid css selector
* `multi` - retrieves a collection of elements and normalizes the return value
* `addListener` - attaches an event listener to element
92 changes: 91 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,91 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["AnimateMe"] = factory();
else
root["AnimateMe"] = factory();
})(window, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
value: true
});
Expand Down Expand Up @@ -40,4 +126,8 @@ var addListener = function addListener(element, eventType, callback, shouldBubbl
}, shouldBubble);
};

exports.addListener = addListener;
exports.addListener = addListener;

/***/ })
/******/ ]);
});
1 change: 1 addition & 0 deletions dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{
"name": "@three11/dom-helpers",
"version": "0.1.0",
"version": "0.2.0",
"description": "Helper functions for faster DOM scripting",
"main": "dist/index.js",
"scripts": {
"build": "babel src -d dist"
"build": "webpack"
},
"repository": {
"type": "git",
"url": "git+https://github.com/three11/dom-helpers.git"
},
"keywords": [
"DOM",
"Helpers",
"JavaScript",
"ES2017"
],
"keywords": ["DOM", "Helpers", "JavaScript", "ES2017"],
"authors": [
{
"name": "Three 11 Ltd",
Expand All @@ -39,9 +34,13 @@
},
"homepage": "https://github.com/three11/dom-helpers#readme",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/preset-stage-2": "^7.0.0-beta.42"
"@babel/cli": "^7.0.0-beta.44",
"@babel/core": "^7.0.0-beta.44",
"@babel/preset-env": "^7.0.0-beta.44",
"@babel/preset-stage-2": "^7.0.0-beta.44",
"babel-loader": "^8.0.0-beta",
"unminified-webpack-plugin": "^2.0.0",
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14"
}
}
20 changes: 20 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const UnminifiedWebpackPlugin = require('unminified-webpack-plugin');

module.exports = {
mode: 'production',
entry: './src/index.js',
output: {
filename: 'index.min.js',
library: 'AnimateMe',
libraryTarget: 'umd'
},
module: {
rules: [
{
test: /\.(js)$/,
loader: 'babel-loader'
}
]
},
plugins: [new UnminifiedWebpackPlugin()]
};
Loading

0 comments on commit 50b850e

Please sign in to comment.