]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
perf: exclude transpiled prompts code (#121)
author翠 / green <green@sapphi.red>
Tue, 12 Jul 2022 09:09:04 +0000 (18:09 +0900)
committerGitHub <noreply@github.com>
Tue, 12 Jul 2022 09:09:04 +0000 (17:09 +0800)
scripts/build.mjs

index b255ccd673d69d5af3589cb863cae83bef7c90aa..f832a89e2bb029107db1d52987ff0352e8abd9ca 100644 (file)
@@ -33,6 +33,16 @@ await esbuild.build({
   target: 'node14',
 
   plugins: [
+    {
+      name: 'alias',
+      setup({ onResolve, resolve }) {
+        onResolve({ filter: /^prompts$/, namespace: 'file' }, async ({ importer, resolveDir }) => {
+          // we can always use non-transpiled code since we support 14.16.0+
+          const result = await resolve('prompts/lib/index.js', { importer, resolveDir })
+          return result
+        })
+      }
+    },
     esbuildPluginLicense({
       thirdParty: {
         includePrivate: false,