How to use rollup-plugin-prettier - 6 common examples

To help you get started, we’ve selected a few rollup-plugin-prettier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pqina / filepond / rollup.scripts.js View on Github external
filename.push('.min');
	}
	filename.push('.js');

	// collect plugins
	const plugins = [];
	if (transpile) {
		plugins.push(babel({
			exclude: ['node_modules/**']
		}));
	}
	if (minify) {
		plugins.push(terser());
	}
	else {
		plugins.push(prettier({
			singleQuote: true,
			parser: 'babel'
		}));
	}
	plugins.push(license({banner: banner(options)}));
	
	// return Rollup config
	return {
		input: 'src/js/index.js',
		treeshake: false,
		output: [
			{
				format,
				name: id,
				file: filename.join('')
			}
github pqina / filepond-plugin-file-validate-type / rollup.scripts.js View on Github external
filename.push('.min');
	}
	filename.push('.js');

	// collect plugins
	const plugins = [];
	if (transpile) {
		plugins.push(babel({
			exclude: ['node_modules/**']
		}))
	}
	if (minify) {
		plugins.push(terser())
	}
	else {
		plugins.push(prettier({
			singleQuote: true,
			parser: 'babel'
		}))
	}
	plugins.push(license(createBanner(options)))
	
	// return Rollup config
	return {
		input: 'src/js/index.js',
		treeshake: false,
		output: [
			{
				format,
				name: id,
				file: filename.join('')
			}
github jpb12 / react-tree-graph / rollup.config.js View on Github external
name: 'ReactTreeGraph'
	},
	plugins: [
		babel({
			exclude: 'node_modules/**'
		}),
		clear({
			targets: ['dist']
		}),
		progress()
	]
};

const devConfig = clone(defaultConfig);
devConfig.output.file = 'dist/index.js';
devConfig.plugins.push(prettier({
	singleQuote: true,
	useTabs: true
}));
devConfig.plugins.unshift(postcss({
	extract: 'dist/style.css'
}));

const prodConfig = clone(defaultConfig);
prodConfig.output.file = 'dist/index.min.js';
prodConfig.plugins.push(uglify());
prodConfig.plugins.unshift(postcss({
	extract: 'dist/style.min.css',
	minimize: true
}));

export default [
github DrSensor / rollup-plugin-rust / rollup.config.js View on Github external
index: "src/main.js",
			cargo: "node_modules/rust-native-wasm-loader/dist/cargo.js"
		},
		output: {
			dir: dirname(pkg.main),
			format: "cjs",
			exports: "named"
		},
		experimentalCodeSplitting: true,
		plugins: [
			eslint(),
			babel(),
			commonjs(),
			resolve(),
			autoExternal(),
			prettier(prettierrc.files("*.js"))
		]
	}
]
github SpringRoll / SpringRoll / rollup.config.js View on Github external
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import eslint from 'rollup-plugin-eslint';
import prettier from 'rollup-plugin-prettier';
import uglify from 'rollup-plugin-uglify';
import pkg from './package.json';
import babel from 'rollup-plugin-babel';

const prettierConfig = require('./.prettierrc');

const plugins = [
  eslint(),
  prettier(prettierConfig),
  resolve({
    module: true,
    jsnext: true,
    main: true,
    browser: true,
    preferBuiltins: false
  }),
  commonjs({
    namedExports: {
      'bellhop-iframe': ['Bellhop']
    }
  }),
  babel(),
  uglify()
];
github SpringRoll / Bellhop / rollup.config.js View on Github external
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import eslint from 'rollup-plugin-eslint';
import prettier from 'rollup-plugin-prettier';
import uglify from 'rollup-plugin-uglify';
import babel from 'rollup-plugin-babel';

const prettierConfig = require('./.prettierrc');

const plugins = [
  eslint(),
  prettier(prettierConfig),
  resolve({
    module: true,
    jsnext: true,
    main: true,
    browser: true,
    preferBuiltins: false
  }),
  commonjs(),
  babel(),
  uglify()
];

export default [
  {
    input: 'src/index.js',
    output: [

rollup-plugin-prettier

Run prettier formatter with rollup

MIT
Latest version published 1 year ago

Package Health Score

61 / 100
Full package analysis

Popular rollup-plugin-prettier functions