modernize frontend-embed to target the same ES and TS standards as the rest of the app
This commit is contained in:
parent
73481990ea
commit
0a5c9f79e5
9 changed files with 109 additions and 79 deletions
|
|
@ -1,9 +1,9 @@
|
|||
// Original: https://github.com/rollup/plugins/tree/8835dd2aed92f408d7dc72d7cc25a9728e16face/packages/json
|
||||
|
||||
import JSON5 from 'json5';
|
||||
import { Plugin } from 'rollup';
|
||||
import { createFilter, dataToEsm } from '@rollup/pluginutils';
|
||||
import { RollupJsonOptions } from '@rollup/plugin-json';
|
||||
import type { Plugin } from 'rollup';
|
||||
import type { RollupJsonOptions } from '@rollup/plugin-json';
|
||||
|
||||
// json5 extends SyntaxError with additional fields (without subclassing)
|
||||
// https://github.com/json5/json5/blob/de344f0619bda1465a6e25c76f1c0c3dda8108d9/lib/parse.js#L1111-L1112
|
||||
|
|
@ -19,7 +19,6 @@ export default function json5(options: RollupJsonOptions = {}): Plugin {
|
|||
return {
|
||||
name: 'json5',
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
transform(json, id) {
|
||||
if (id.slice(-6) !== '.json5' || !filter(id)) return null;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue