Skip to content

Commit

Permalink
Import package JSON using require
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldzjap committed Jul 26, 2024
1 parent 4dc2a5b commit edb0c7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/no-var-requires": [
"error",
{
"allow": ["/package\\.json$"]
}
],
"require-jsdoc": [
"error",
{
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"types": "dist/index.d.ts",
"scripts": {
"test": "cross-env NODE_ENV=test npx jest",
"development": "cross-env NODE_ENV=local npx rollup --config rollup.config.ts --configPlugin typescript",
"development": "cross-env NODE_ENV=local npx rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript",
"dev": "npm run development",
"production": "cross-env NODE_ENV=production npx rollup --config rollup.config.ts --configPlugin typescript",
"production": "cross-env NODE_ENV=production npx rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript",
"prod": "npm run production",
"watch": "cross-env NODE_ENV=local npx rollup --config rollup.config.ts --configPlugin typescript --watch",
"watch": "cross-env NODE_ENV=local npx rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript --watch",
"lint": "npx eslint --ext .tsx,.ts ./",
"clean": "rm -rf dist"
},
Expand Down
3 changes: 1 addition & 2 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';

import pkg from './package.json' assert { type: 'json' };

const pkg = require('./package.json');
const local = process.env.NODE_ENV === 'local';

export default {
Expand Down

0 comments on commit edb0c7f

Please sign in to comment.