How to use line-number plugin with webpack
See original GitHub issueI hava code link this. But it not show line number
const Prism = require('prismjs/components/prism-core.js');
require('prismjs/plugins/line-numbers/prism-line-numbers.js');
require('prismjs/themes/prism.css');
require('prismjs/components/prism-javascript');
const code = 'var a = 1;';
render() {
<pre className="line-numbers" data-start="0">
<code className="language-javascript" dangerouslySetInnerHTML={{ __html: code }} />
</pre>
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Webpack from Nothing - Stack Traces and Line Numbers that ...
The main disadvantage is that it doesn't display line numbers correctly. Like…why am I using source maps if I am also OK with...
Read more >TerserWebpackPlugin | webpack
This plugin uses terser to minify/minimize your JavaScript. Getting Started. Webpack v5 comes with the latest terser-webpack-plugin out of the box. If you...
Read more >webpack-dev-server: how to get error line numbers of orignal ...
I'm using webpack with babel for ES2015 js. Screenshot. webpack.config.dev.js. const path = require('path'); const webpack = require('webpack'); ...
Read more >Line Numbers Prism plugins
Add the line-numbers class to your desired <pre> or any of its ancestors, and the Line Numbers plugin will take care of the...
Read more >Add Line Numbers to Prismjs Code Blocks in a Next.js Project
</code> block is required to get highlighting to work. ... npm install prismjs ... import 'prismjs/plugins/line-numbers/prism-line-numbers.js' import ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mAAdhaTTah Awesome man! It works, thanks here is the complete working code:
In Vue.js Components
ReView
Others
babel-plugin-prismjs, i don’t know it how to work?😂