From 96ab831551550056143543f366b4dc5f4673128b Mon Sep 17 00:00:00 2001 From: Michael Dzjaparidze Date: Wed, 31 Jul 2024 13:24:59 +0200 Subject: [PATCH] Import JSON differently --- package.json | 6 +++--- rollup.config.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2146d62..a9f15da 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "scripts": { "test": "cross-env NODE_ENV=test ./node_modules/.bin/jest", "lint": "npx eslint --ext .ts,.js ./", - "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" }, "repository": { "type": "git", diff --git a/rollup.config.ts b/rollup.config.ts index f778daa..bc46670 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -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 {