TehShrike / svelte-preprocess-postcss

Use PostCSS to preprocess your styles in Svelte components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getting warnings

ralyodio opened this issue · comments

Not finding postcss.config.js

import svelte from 'rollup-plugin-svelte';
import replace from 'rollup-plugin-replace';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import sveltePreprocessPostcss from 'svelte-preprocess-postcss'
import postcss from 'rollup-plugin-postcss'

require('dotenv').config();

const stylePreprocessor = sveltePreprocessPostcss({
	configFilePath: 'postcss.config.js',
	useConfigFile: true,
});


const production = !process.env.ROLLUP_WATCH;

export default {
	input: 'src/main.js',
	output: {
		sourcemap: true,
		format: 'iife',
		name: 'app',
		file: 'public/bundle.js'
	},
	plugins: [
		postcss({
			config: {
				path: 'postcss.config.js'
			}
		}),
		svelte({
			// enable run-time checks when not in production
			dev: !production,
			// we'll extract any component CSS out into
			// a separate file — better for performance
			preprocess: {
				style: stylePreprocessor
			},
			/**
			 * It is also possible to manually enqueue
			 * stand-alone processors
			 * */			
			css: css => {
				css.write('public/bundle.css');
			}
		}),
		replace({
			'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
		}),
		// If you have external dependencies installed from
		// npm, you'll most likely need these plugins. In
		// some cases you'll need additional configuration —
		// consult the documentation for details:
		// https://github.com/rollup/rollup-plugin-commonjs
		resolve({
			browser: true,
			dedupe: importee => importee === 'svelte' || importee.startsWith('svelte/')
		}),
		commonjs(),

		// Watch the `public` directory and refresh the
		// browser on changes when not in production
		!production && livereload('public'),

		// If we're building for production (npm run build
		// instead of npm run dev), minify
		production && terser()
	],
	watch: {
		clearScreen: false
	}
};

You did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js.

I don't understand, are you asking a question?

postcss is working fine. I don'jt know why we are getting awarnings.

What warnings are you seeing?