Skip to content

Commit 8c99673

Browse files
committed
license, browser fix
1 parent 7a6ba63 commit 8c99673

File tree

6 files changed

+82
-44
lines changed

6 files changed

+82
-44
lines changed

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) 2020 Damir Yusipov
2+
3+
MIT License:
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

Diff for: browser/patchpack.js

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
2-
/******/ (function(modules) { // webpackBootstrap
1+
2+
(function webpackUniversalModuleDefinition(root, factory) {
3+
if(typeof exports === 'object' && typeof module === 'object')
4+
module.exports = factory();
5+
else if(typeof define === 'function' && define.amd)
6+
define([], factory);
7+
else if(typeof exports === 'object')
8+
exports["patchpack"] = factory();
9+
else
10+
root["patchpack"] = factory();
11+
})(self || this, function() {
12+
return /******/ (function(modules) { // webpackBootstrap
313
/******/ // The module cache
414
/******/ var installedModules = {};
515
/******/
@@ -1214,4 +1224,5 @@ module.exports = decode;
12141224

12151225

12161226
/***/ })
1217-
/******/ ]);
1227+
/******/ ]);
1228+
});

Diff for: browser/patchpack.min.js

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "patchpack",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Json patch serializer",
55
"main": "dist/index.js",
66
"source": "src/index.ts",

Diff for: readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ npm install --save patchpack
2525
## Browser
2626
A browser version of patchpack is also available:
2727
```
28-
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/browser/patchpack.min.js"></script>
29-
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/browser/patchpack.js"></script>
28+
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/browser/patchpack.min.js"></script>
29+
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/browser/patchpack.js"></script>
3030
```
3131

3232
## Example

Diff for: webpack.config.js

+42-37
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,47 @@ const path = require('path')
33
const pkg = require('./package.json');
44
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
55

6-
module.exports = function (options) {
7-
if (!options) options = {};
8-
9-
return {
10-
mode: "production",
11-
entry: {
12-
"patchpack": path.join(__dirname, "index.ts"),
13-
"patchpack.min": path.join(__dirname, "index.ts"),
14-
},
15-
output: {
16-
path: path.join(__dirname, "./browser/"),
17-
filename: "[name].js",
18-
19-
globalObject: "self || this", // compatibility with Web Workers.
20-
},
21-
22-
module: {
23-
rules: [
24-
{ test: /\.ts$/, loader: "ts-loader" },
25-
],
26-
},
27-
28-
plugins: [
29-
new webpack.BannerPlugin({ banner: `patchpack@${pkg.version}` }),
30-
],
31-
32-
optimization: {
33-
minimize: true,
34-
minimizer: [new UglifyJsPlugin({
35-
include: /\.min\.js$/
36-
})]
37-
},
38-
39-
resolve: {
40-
extensions: ['.ts', '.js', '.json']
41-
}
6+
module.exports = function(options) {
7+
if (!options) options = {};
8+
9+
return {
10+
mode: "production",
11+
entry: {
12+
"patchpack": path.join(__dirname, "index.ts"),
13+
"patchpack.min": path.join(__dirname, "index.ts"),
14+
},
15+
output: {
16+
path: path.join(__dirname, "./browser/"),
17+
filename: "[name].js",
18+
19+
globalObject: "self || this", // compatibility with Web Workers.
20+
libraryTarget: "umd",
21+
library: "patchpack"
22+
},
23+
24+
// devtool: 'inline-source-map',
25+
26+
module: {
27+
rules: [
28+
{ test: /\.ts$/, loader: "ts-loader" },
29+
],
30+
},
31+
32+
plugins: [
33+
new webpack.BannerPlugin({ banner: `patchpack@${pkg.version}` }),
34+
// new webpack.optimize.UglifyJsPlugin({ include: /\.min\.js$/, minimize: true})
35+
],
36+
37+
optimization: {
38+
minimize: true,
39+
minimizer: [new UglifyJsPlugin({
40+
include: /\.min\.js$/
41+
})]
42+
},
43+
44+
resolve: {
45+
extensions: ['.ts', '.js', '.json']
46+
}
4247

43-
}
48+
}
4449
};

0 commit comments

Comments
 (0)