LinbuduLab / esbuild-plugins

ESBuild plugins by @LinbuduLab
MIT License
113 stars 18 forks source link

TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) -- Using esbuild-plugin-alias-path #97

Closed Murtatrxx closed 1 year ago

Murtatrxx commented 1 year ago

I tried it and added to tsup plugins, just like that put throws out that error.

import { defineConfig } from 'tsup';
import { aliasPath as esbuildPluginAliasPath } from 'esbuild-plugin-alias-path';

import path from 'node:path';

export default defineConfig({
  bundle: true,
  clean: true,
  dts: false,
  entry: ['source/**/*.ts', '!source/**/*.d.ts'],
  format: ['cjs'],
  minify: process.env.NODE_ENV == 'development' ? false : true,
  outDir: 'dist/bot',
  tsconfig: 'tsconfig.json',
  target: 'es2018',
  silent: true,
  plugins: [
    esbuildPluginAliasPath({
      alias: {
        "@config": path.resolve(__dirname, "./dist/bot/config.js"),
        "@library/*": path.resolve(__dirname, "./dist/bot/library/"),
        "@translations/*": path.resolve(__dirname, "./translations/"),
        "@root/*": path.resolve(__dirname, "./")
      }
    })
  ],
  splitting: false,
  skipNodeModulesBundle: true,
  sourcemap: true,
  shims: false,
  keepNames: true
});
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at file:///C:/Users/PC/OneDrive/Documents/project/node_modules/esbuild-plugin-alias-path/dist/index.mjs:20:30
    at Array.forEach (<anonymous>)