Skip to content

@rollup/plugin-commonjs not resolving commonjs module lilconfig #1673

Closed

Description

@socketopp

"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"rollup-plugin-postcss": "^4.0.2",

I am using rollup-plugin-postcss to inject css with js so I don't have to do it manually.
I am using ES and it's complaining about lilconfig\dist\index.js not supporting ES modules. But I think it's fixed in version 10.0.0 of postcss-cli.

Then I found commonjs and I was thinking it could resolve this issue but it persists.

I will create a replication if necessary in this case.

import svelte from 'rollup-plugin-svelte';
import { terser } from 'rollup-plugin-terser';
import sveltePreprocess from 'svelte-preprocess';
import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import resolve from '@rollup/plugin-node-resolve';

export default {
	input: 'src/main.ts',
	output: {
		sourcemap: true,
		format: 'iife',
		name: 'app',
		file: 'public/build/bundle.min.js',
		plugins: [terser()]
	},
	plugins: [
		commonjs(),
		resolve({
			browser: true,
			dedupe: ['svelte']
		}),
		postcss({
			extensions: ['.css'],
			minimize: true,
			inject: {
				insertAt: 'top'
			}
		}),
		svelte({
			preprocess: sveltePreprocess({
				postcss: true
			}),
		}),
	],
};

Activity

  1. locked and limited conversation to collaborators on Feb 8, 2024
  2. converted this issue into a discussion #1675 on Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions