diff --git a/packages/snippetz/src/format.ts b/packages/snippetz/src/format.ts index 9423b2d..e14c038 100644 --- a/packages/snippetz/src/format.ts +++ b/packages/snippetz/src/format.ts @@ -1,6 +1,6 @@ import babel from 'prettier/plugins/babel' import estree from 'prettier/plugins/estree' -import * as prettier from 'prettier/standalone' +import * as prettier from 'prettier' export async function format(source: any) { const target = source.target diff --git a/packages/snippetz/vite.config.ts b/packages/snippetz/vite.config.ts index 47b2988..78eb460 100644 --- a/packages/snippetz/vite.config.ts +++ b/packages/snippetz/vite.config.ts @@ -9,6 +9,20 @@ export default defineConfig({ name: meta.name, fileName: 'index', }, + rollupOptions: { + external: [ + 'prettier', + 'prettier/plugins/babel', + 'prettier/plugins/estree', + ], + output: { + globals: { + prettier: 'prettier', + 'prettier/plugins/babel': 'babel', + 'prettier/plugins/estree': 'estree', + }, + }, + }, }, resolve: { alias: [