egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.46k stars 209 forks source link

Entry point cannot be marked as external when making node_modules external for node, on Windows. #1096

Open fenilli opened 3 months ago

fenilli commented 3 months ago

When I run build I get "The entry point cannot be marked as external" with this being the resolver plugin, only on windows machines, it works fine for wsl and posix.

      {
        name: 'make-all-packages-external',
        setup(build) {
          // iife files should be fully bundled.
          if (build.initialOptions.outExtension?.['.js'].startsWith('.iife.js')) {
            const filter = /^vue$/
            build.onResolve({ filter }, () => {
              return {
                path: 'Vue',
                external: true,
              }
            })
          } else {
            // It fails here!
            const filter = /^[^.\/]|^\.[^.\/]|^\.\.[^\/]/ // Must not start with "/" or "./" or "../"
            build.onResolve({ filter }, args => ({ path: args.path, external: true }))
          }
        },
      },

Upvote & Fund

Fund with Polar