Skip to content

Commit 05a6967

Browse files
committed
feat: add json plugin to compile plugins
1 parent 9fd84d8 commit 05a6967

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"dependencies": {
6464
"@rollup/plugin-babel": "^5.3.0",
6565
"@rollup/plugin-commonjs": "^19.0.1",
66+
"@rollup/plugin-json": "^4.1.0",
6667
"@rollup/plugin-node-resolve": "^13.0.2",
6768
"@rollup/plugin-typescript": "^8.2.3",
6869
"core-js": "^3.15.2",

src/rollup-common.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import typescript, { RollupTypescriptOptions } from "@rollup/plugin-typescript";
22
import babel, { RollupBabelInputPluginOptions } from "@rollup/plugin-babel";
3+
import json from "@rollup/plugin-json";
34
import type { Plugin } from "rollup";
45

56
export interface CompilePluginsOptions {
@@ -9,6 +10,8 @@ export interface CompilePluginsOptions {
910

1011
export function compilePlugins(options: CompilePluginsOptions = {}): Plugin[] {
1112
return [
13+
// https://www.npmjs.com/package/@rollup/plugin-json
14+
json(),
1215
// https://github.com/rollup/plugins/tree/master/packages/typescript
1316
typescript({
1417
tsconfig: "tsconfig.json",

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,13 @@
15171517
magic-string "^0.25.7"
15181518
resolve "^1.17.0"
15191519

1520+
"@rollup/plugin-json@^4.1.0":
1521+
version "4.1.0"
1522+
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3"
1523+
integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==
1524+
dependencies:
1525+
"@rollup/pluginutils" "^3.0.8"
1526+
15201527
"@rollup/plugin-node-resolve@^13.0.2":
15211528
version "13.0.2"
15221529
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.2.tgz#bfe58e9bfc7284ee0fabc6da7fabcb268f04e0a4"
@@ -1537,7 +1544,7 @@
15371544
"@rollup/pluginutils" "^3.1.0"
15381545
resolve "^1.17.0"
15391546

1540-
"@rollup/pluginutils@^3.1.0":
1547+
"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0":
15411548
version "3.1.0"
15421549
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
15431550
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==

0 commit comments

Comments
 (0)