Skip to content

Commit 4c09895

Browse files
committed
Add new build process
1 parent 462a8cd commit 4c09895

File tree

6 files changed

+3807
-76
lines changed

6 files changed

+3807
-76
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ or
1414
yarn add @three11/accordion
1515
```
1616

17+
or
18+
19+
Just download this repository and link the files located in dist folder:
20+
21+
```
22+
<link rel="stylesheet" href="dist/index.css" type="text/css" media="all" />
23+
24+
<script src="dist/index.min.js"></script>
25+
```
26+
1727
## Usage
1828

1929
First, `import` the module:

dist/index.js

Lines changed: 91 additions & 1 deletion
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["Accordion"] = factory();
8+
else
9+
root["Accordion"] = 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
});
@@ -137,4 +223,8 @@ function () {
137223
return Accordion;
138224
}();
139225

140-
exports.default = Accordion;
226+
exports.default = Accordion;
227+
228+
/***/ })
229+
/******/ ])["default"];
230+
});

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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
{
22
"name": "@three11/accordion",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Front-end Accordion widget using max-height",
55
"main": "dist/index.js",
66
"scripts": {
7-
"build": "babel src -d dist"
7+
"build": "webpack"
88
},
99
"repository": {
1010
"type": "git",
1111
"url": "git+https://github.com/three11/accordion.git"
1212
},
13-
"keywords": [
14-
"Accordion",
15-
"Widget",
16-
"Front-End"
17-
],
13+
"keywords": ["Accordion", "Widget", "Front-End"],
1814
"authors": [
1915
{
2016
"name": "Three 11 Ltd",
@@ -38,9 +34,13 @@
3834
},
3935
"homepage": "https://github.com/three11/accordion#readme",
4036
"devDependencies": {
41-
"@babel/cli": "^7.0.0-beta.42",
42-
"@babel/core": "^7.0.0-beta.42",
43-
"@babel/preset-env": "^7.0.0-beta.42",
44-
"@babel/preset-stage-2": "^7.0.0-beta.42"
37+
"@babel/cli": "^7.0.0-beta.44",
38+
"@babel/core": "^7.0.0-beta.44",
39+
"@babel/preset-env": "^7.0.0-beta.44",
40+
"@babel/preset-stage-2": "^7.0.0-beta.44",
41+
"babel-loader": "^8.0.0-beta",
42+
"unminified-webpack-plugin": "^2.0.0",
43+
"webpack": "^4.5.0",
44+
"webpack-cli": "^2.0.14"
4545
}
4646
}

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: 'Accordion',
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)