How to use @rollup/plugin-url - 3 common examples

To help you get started, we’ve selected a few @rollup/plugin-url 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 bitrix-tools / cli / src / plugins / rollup / rollup-plugin-image / index.js View on Github external
return context;
	})();

	console.log(context);
	console.log(resolveToProductPath(context));

	const rollupUrlOptions = {
		fileName: '[dirname][name][extname]',
		...restContentImages,
		publicPath: path.join(modulePath, destDir, '/'),
		destDir,
		sourceDir: path.dirname(input),
		limit: 0,
	};

	return rollupUrl(rollupUrlOptions);
}
github bitrix-tools / cli / src / plugins / rollup / rollup-plugin-files / index.js View on Github external
destDir: options.resolveFilesImport.output,
			output: options.output,
			context: options.context,
		});

		const rollupUrlOptions = {
			fileName: '[dirname][name][extname]',
			publicPath: path.join(productContext, destDir, '/'),
			destDir: path.join(options.context, destDir),
			sourceDir: path.dirname(options.input),
			include: options.resolveFilesImport.include,
			exclude: options.resolveFilesImport.exclude,
			limit: 0,
		};

		return rollupUrl(rollupUrlOptions);
	}

	return undefined;
}
github wellyshen / react-cool-img / rollup / config.js View on Github external
};

const extensions = ['.js', '.ts', '.tsx', '.json'];
const plugins = [
  resolve({ extensions }),
  commonjs({
    namedExports: {
      react: Object.keys(React),
      'react-dom': Object.keys(ReactDOM)
    }
  }),
  babel({ exclude: 'node_modules/**', extensions }),
  replace({
    'process.env.NODE_ENV': JSON.stringify(isDev ? 'development' : 'production')
  }),
  !isLib && url(),
  !isLib && postcss({ extract: true, sourceMap: isDev, minimize: !isDev }),
  !isLib && html({ template }),
  !isLib &&
    copy({
      targets: [
        { src: 'src/static/example_assets', dest: 'src/.dev', rename: 'assets' }
      ]
    }),
  isDev && serve('src/.dev'),
  isDev && livereload(),
  !isDev && terser(),
  !isDev && filesize(),
  isExample &&
    copy({
      targets: [{ src: 'src/.dev', dest: '.', rename: 'example' }],
      hook: 'writeBundle'

@rollup/plugin-url

Import files as data-URIs or ES Modules

MIT
Latest version published 1 year ago

Package Health Score

84 / 100
Full package analysis

Popular @rollup/plugin-url functions