Skip to content

Commit

Permalink
fix: revert changing build directory to dist
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Jul 22, 2023
1 parent 2756120 commit 3b9923b
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ npm-debug.log
node_modules
build/*
!build/jwt-decode.js
coverage/*
dist/*
coverage/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const jwt_decode = require('jwt-decode');

#### Include with a script tag

Copy the file `jwt-decode.js` from the `dist/` folder to your project somewhere, then include it like so:
Copy the file `jwt-decode.js` from the `build/` folder to your project somewhere, then include it like so:

```html
<script src="jwt-decode.js"></script>
Expand Down
82 changes: 82 additions & 0 deletions build/jwt-decode.js

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

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "jwt-decode",
"version": "3.1.2",
"description": "Decode JWT tokens, mostly useful for browser applications.",
"main": "dist/cjs/jwt-decode.js",
"module": "dist/esm/jwt-decode.js",
"types": "dist/typings/index.d.ts",
"main": "build/cjs/jwt-decode.js",
"module": "build/esm/jwt-decode.js",
"types": "build/typings/index.d.ts",
"keywords": [
"jwt",
"browser"
Expand All @@ -17,8 +17,8 @@
"homepage": "https://github.com/auth0/jwt-decode#readme",
"scripts": {
"dev": "rollup -m -c",
"build": "rimraf dist && rollup -m -c --environment NODE_ENV:production",
"postbuild": "echo '{\"type\": \"commonjs\"}'> dist/cjs/package.json",
"build": "rimraf build && rollup -m -c --environment NODE_ENV:production",
"postbuild": "echo '{\"type\": \"commonjs\"}'> build/cjs/package.json",
"test": "npm run test:node && npm run test:browser",
"test:node": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --coverage",
"test:browser": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest --coverage --testEnvironment=jsdom"
Expand Down Expand Up @@ -50,7 +50,7 @@
"uglify-js": "^3.15.2"
},
"files": [
"dist/",
"build/",
"index.d.ts"
],
"engines": {
Expand All @@ -59,9 +59,9 @@
"type": "module",
"exports": {
".": {
"require": "./dist/cjs/jwt-decode.js",
"import": "./dist/esm/jwt-decode.js",
"types": "./dist/typings/index.d.ts"
"require": "./build/cjs/jwt-decode.js",
"import": "./build/esm/jwt-decode.js",
"types": "./build/typings/index.d.ts"
}
}
}
8 changes: 4 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default [{
input: "lib/index.standalone.ts",
output: {
name: "jwt_decode",
file: "dist/jwt-decode.js",
file: "build/jwt-decode.js",
format: "umd",
},
plugins: [
Expand All @@ -55,7 +55,7 @@ export default [{
input: "lib/index.cjs.ts",
output: [{
name: EXPORT_NAME,
file: "dist/cjs/jwt-decode.js",
file: "build/cjs/jwt-decode.js",
format: "cjs",
exports: "auto",
}, ],
Expand All @@ -65,12 +65,12 @@ export default [{
input: "lib/index.ts",
output: [{
name: EXPORT_NAME,
file: "dist/esm/jwt-decode.js",
file: "build/esm/jwt-decode.js",
format: "esm",
}, ],
plugins: [!isProduction &&
serve({
contentBase: ["dist", "static"],
contentBase: ["build", "static"],
open: true,
port: 3000,
}), !isProduction && livereload(),
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"esModuleInterop": true,
"sourceMap": true,
"declaration": true,
"declarationDir": "./dist/typings",
"declarationDir": "./build/typings",
"moduleResolution": "node",
"noImplicitAny": true,
"downlevelIteration": true,
Expand All @@ -16,6 +16,6 @@
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
},
"exclude": ["./test", "./dist/typings"]
"exclude": ["./test", "./build/typings"]
}

0 comments on commit 3b9923b

Please sign in to comment.