UNPKG

markdown-it-ftoc

Version:

markdown-it plugin to add toc and anchor links in headings

48 lines (45 loc) 1.06 kB
const path = require('path') const webpack = require('webpack') // to access built-in plugins const { CleanWebpackPlugin } = require('clean-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin') module.exports = { entry: './src/index.js', output: { filename: 'index.min.js', path: path.resolve(__dirname, 'dist'), libraryTarget: 'umd', globalObject: 'this', library: 'markdownItFtoc' }, module: { rules: [{ test: /\.(js|jsx)$/, loader: 'babel-loader' }, { test: /\.html$/, use: [ { loader: 'html-loader', options: { minimize: true } } ] }] }, devtool: process.env.NODE_ENV === 'development' ? 'process.env.NODE_ENV' : false, devServer: { contentBase: './dist', hot: true }, plugins: [ new webpack.ProgressPlugin(), new webpack.NamedModulesPlugin(), new webpack.HotModuleReplacementPlugin(), new CleanWebpackPlugin(), new HtmlWebpackPlugin({ template: './src/index.html' }) ] }