Skip to content

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

@socketopp

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
			}),
		}),
	],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions