prismjs-loader

prismjs webpack loader

Usage no npm install needed!

<script type="module">
  import prismjsLoader from 'https://cdn.skypack.dev/prismjs-loader';
</script>

README

prismjs-loader for webpack

prismjs-loader for webpack, http://prismjs.com/

Installation

npm install -D prismjs-loader

Usage

Don't forget to provide file type via query, so loader can choose correct component to use. List of components to use: link If component called prism-apacheconf.js you need to provide apacheconf via query.

On ui you need to add ref to stylesheet with prism theme, demo of themes here, list of stylesheets here

Note: don't use this loader in configuration, most probably you don't need it there

Important: use !! in require, to disable all other file loaders from webpack configuration

var fileContent = require('!!prismjs?lang=markdown!./template.html');
// => returns highlighted html content

var fileContent = require('!!prismjs?lang=javascript!./index.js');
// => returns highlighted javascript content

Contribution and Feature requests

If you need support of plugins welcome to create an issue or pull request, currently plugins are not supported

License

MIT