Is it possible to import the package.json into the rollup.config.js?
raphaelokon opened this issue · 1 comments
raphaelokon commented
Hi there. I want to do the following but it throws a PARSE_ERROR as it tries to parse the json
as js
:
import json from "rollup-plugin-json";
import pkg from "../package.json";
export default {
banner : `${name} – ${version}`,
entry : "src/index.js",
plugins : [
json()
]
};
Victorystick commented
Since the config file is executed by Node, you can just go with a require
.
import ...
const pkg = require('../package.json');
export ...