Skip to content

Commit

Permalink
fix: Support IE
Browse files Browse the repository at this point in the history
Introduces support for older browsers, adds minification step to bundler

Fixes #52
  • Loading branch information
maticzav committed Mar 12, 2019
1 parent eb83740 commit 93683f9
Show file tree
Hide file tree
Showing 6 changed files with 1,398 additions and 75 deletions.
5 changes: 5 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"clean": "rimraf dist",
"compile": "tsc -d",
"compile": "webpack",
"pretest": "npm run clean && npm run compile",
"test": "echo 'test'",
"posttest": "npm run lint",
Expand All @@ -29,15 +29,21 @@
"@types/next": "7.0.9",
"@types/node": "10.12.30",
"@types/set-cookie-parser": "0.0.4",
"prettier": "1.16.4",
"husky": "^1.3.1",
"prettier": "^1.16.4",
"prettier-check": "2.0.0",
"pretty-quick": "^1.10.0",
"rimraf": "2.6.3",
"semantic-release": "15.13.3",
"ts-loader": "^5.3.3",
"ts-node": "8.0.3",
"tslint": "5.13.1",
"tslint-config-prettier": "1.18.0",
"tslint-config-standard": "8.0.1",
"typescript": "3.3.3333"
"typescript": "3.3.3333",
"uglifyjs-webpack-plugin": "^2.1.2",
"webpack": "^4.29.6",
"webpack-cli": "^3.2.3"
},
"keywords": [
"cookie",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const isBrowser = () => typeof window !== 'undefined'
* @param a first Cookie for comparision
* @param b second Cookie for comparision
*/
function areCookiesEqual(a: Cookie, b: Cookie & CookieSerializeOptions ) {
function areCookiesEqual(a: Cookie, b: Cookie & CookieSerializeOptions) {
return (
a.name === b.name &&
a.domain === b.domain &&
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es6",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"noUnusedLocals": true,
Expand Down
26 changes: 26 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const path = require('path')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')

module.exports = {
mode: 'production',
entry: './src/index.ts',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
optimization: {
minimizer: [new UglifyJsPlugin()],
},
}
Loading

0 comments on commit 93683f9

Please sign in to comment.