`exports` found in bundle when format set to `esm` (using `@rollup/plugin-node-resolve`)

Viewed 35

I have nodeResolve set to only resolve svelte (since I only use stores) and string-argv

// rollup.config.js
import { nodeResolve } from '@rollup/plugin-node-resolve'
import { defineConfig } from 'rollup'

const config = defineConfig({
    input: 'main.js',
    output: {
        file: 'bundle.js',
        format: "esm"
    },
    plugins: [nodeResolve({
        preferBuiltins: true,
        resolveOnly: ['svelte', 'string-argv']
    })],
    external: ['cac', 'colors'],
})

export default config

but for some reason references to exports is included in my bundle and importing the module doesn't work. How do i fix this?

EDIT: i checked the string-argv code in node_modules and all the references to exports is in that module.

0 Answers
Related