From 1ca0404be1b948d72c48e7b60bac7a550f9d8c8b Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Wed, 20 Jan 2021 12:49:45 +0100 Subject: [PATCH] Deduplicate acorn import (#3929) --- rollup.config.js | 3 ++- src/utils/options/normalizeInputOptions.ts | 1 + typings/declarations.d.ts | 11 ----------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 68a4d365bcd..fb27c72b742 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -49,7 +49,8 @@ const moduleAliases = { resolve: ['.js', '.json', '.md'], entries: [ { find: 'help.md', replacement: path.resolve('cli/help.md') }, - { find: 'package.json', replacement: path.resolve('package.json') } + { find: 'package.json', replacement: path.resolve('package.json') }, + { find: 'acorn', replacement: path.resolve('node_modules/acorn/dist/acorn.mjs') } ] }; diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index 25526d58b2e..b94c3a71776 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -1,3 +1,4 @@ +import * as acorn from 'acorn'; import injectClassFields from 'acorn-class-fields'; import injectStaticClassFeatures from 'acorn-static-class-features'; import { diff --git a/typings/declarations.d.ts b/typings/declarations.d.ts index 22a2d3138c0..5473605cc86 100644 --- a/typings/declarations.d.ts +++ b/typings/declarations.d.ts @@ -1,5 +1,4 @@ // internal -declare module 'rollup'; declare module 'help.md' { const str: string; export default str; @@ -16,16 +15,6 @@ declare module 'acorn-class-fields' { export default plugin; } -declare module 'acorn-import-meta' { - const plugin: (BaseParser: typeof acorn.Parser) => typeof acorn.Parser; - export default plugin; -} - -declare module 'acorn-export-ns-from' { - const plugin: (BaseParser: typeof acorn.Parser) => typeof acorn.Parser; - export default plugin; -} - declare module 'fsevents' { export default {}; }