* test: move tests * feat: support legacy JSON formatting * fix: add missing assertion * test: fix coverage * fix: same output as JSON.stringify * refactor: fix linting * refactor: rename to json-stringify * refactor: fix linting * fix: should fix the production build * docs: remove outdated name * fix(playgound): add lib/parser-json-stringify.js * feat(playgound): add example for json-stringify * fix: no error on singleQuote string * fix(playground): correctly load json-stringify * fix: identifier is only allowed in ObjectProperty.key * refactor: clearer
22 lines
788 B
JavaScript
22 lines
788 B
JavaScript
import baseConfig from "./rollup.base.config.js";
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
import commonjs from "rollup-plugin-commonjs";
|
|
import globals from "rollup-plugin-node-globals";
|
|
import json from "rollup-plugin-json";
|
|
|
|
const filepath = process.env.filepath;
|
|
const filename = filepath.replace(/.+\//, "");
|
|
const basename = filename.replace(/\..+/, "");
|
|
|
|
export default Object.assign(baseConfig, {
|
|
entry: "node_modules/prettier/" + filepath,
|
|
dest: "website/static/lib/" + filename,
|
|
format: "iife",
|
|
plugins: [json(), resolve({ preferBuiltins: true }), commonjs(), globals()],
|
|
useStrict: false,
|
|
moduleName: basename
|
|
.replace(/^parser-/, "")
|
|
.replace(/-/g, "_") /* `json-stringify` is not a valid identifier */,
|
|
external: ["assert", "fs", "module"]
|
|
});
|