Skip to content

Solving Duplicate Styles/Scripts warning #54

Answered by webdiscus
kaili-kameoka asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @kaili-kameoka,

you has wrong Webpack config.

Unlike the html-webpack-plugin, the new PugPlugin(..) must be initialised only once in plugins and all Pug files must be defined in Webpack entry.

Please update pug-plugin to v4.6.0. The new version has some improvements and optimization of options.

const path = require('path');
const PugPlugin = require('pug-plugin');

module.exports = {
  entry: {
    // define all Pug files only here
    index: './src/index.pug',
    about: './src/about.pug',
  },
  output: {
    path: path.join(__dirname, 'dist/'),
    publicPath: '/', // Note: this is the path relative by output.path, or `auto`
    clean: true
  },
  plugins: [
    new PugPlugin({

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kaili-kameoka
Comment options

Answer selected by kaili-kameoka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants