Skip to content

bannerConfig should not default if not filled, it should be left out #1250

Open
@chrion02

Description

@chrion02

The default bannerConfig should be left out in:

export const projectConfigDefault: ProjectConfig = {
// Project Identity
appName: 'wpackio', // Unique name of your project
type: 'plugin', // Plugin or theme
slug: 'wpack-io', // Plugin or Theme slug, basically the directory name under `wp-content/<themes|plugins>`
// Used to generate banners on top of compiled stuff
bannerConfig: {
name: 'WordPress WebPack Bundler',
author: 'Swashata Ghosh',
license: 'GPL-3.0',
link: 'https://wpack.io',
version: '1.0.0',
copyrightText:
'This software is released under the GPL-3.0 License\nhttps://opensource.org/licenses/GPL-3.0',
credit: true,
},

Inlining css chunks is not pretty with a bannerConfig for each file. There is no need for a default config. Even bannerConfig: false does just return undefined for every property in:

new webpack.BannerPlugin({
entryOnly: false,
raw: false,
// Add to ts, tsx, css, scss, sass
include: /\.((t|j)sx?|s?(c|a)ss)$/,
banner: `
${bannerConfig.name}
@author ${bannerConfig.author}
@version ${bannerConfig.version}
@link ${bannerConfig.link}
@license ${bannerConfig.license}
Copyright (c) ${new Date().getFullYear()} ${bannerConfig.author}
${bannerConfig.copyrightText}${bannerConfig.credit ? creditNote : ''}`,
})
);
}
// Return it
return plugins;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions