Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chrion02 opened this issue Feb 14, 2022 · 0 comments
Open

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

chrion02 opened this issue Feb 14, 2022 · 0 comments

Comments

@chrion02
Copy link

chrion02 commented Feb 14, 2022

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;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant