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

[RFC] Plugins: Build / Pipeline (webpack) #183

Closed
1 of 5 tasks
thescientist13 opened this issue Aug 26, 2019 · 0 comments
Closed
1 of 5 tasks

[RFC] Plugins: Build / Pipeline (webpack) #183

thescientist13 opened this issue Aug 26, 2019 · 0 comments
Assignees
Labels
Plugins Greenwood Plugins RFC Proposal and changes to workflows, architecture, APIs, etc v0.4.0 Plugins and Packages website Tasks related to the projects website / documentation
Milestone

Comments

@thescientist13
Copy link
Member

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

Taken from a comment in #17 (comment) in regards to a general discussion around the API and capturing the specific action item re: build plugin type here.

Details

Build

Basically you can pass a webpack plugin! Mileage may vary, but we could provide a list of known plugins that work in this way. (like ones that we use in our own plugins)

Usage

For a consumer, usage would look something like this in greenwood.config.js where the provider function in this case returns an instance of a webpack plugin.

example:

const { version } = require('package.json');
const webpack = require('webpack');

module.exports = {
  title: 'My App'
  
  ...
  
  plugins: [{
    type: 'build'
    provider: (compilation) => {
      const { config } = compilation;
      
      return new webpack.BannerPlugin({
        banner: `${config.title} v${version}: built on ${new Date().getTime()}`
      });
    }
  ]
}
@thescientist13 thescientist13 added RFC Proposal and changes to workflows, architecture, APIs, etc Plugins Greenwood Plugins labels Aug 26, 2019
@thescientist13 thescientist13 added this to the MVP milestone Aug 26, 2019
@thescientist13 thescientist13 self-assigned this Sep 6, 2019
@thescientist13 thescientist13 added website Tasks related to the projects website / documentation v0.4.0 Plugins and Packages labels Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugins Greenwood Plugins RFC Proposal and changes to workflows, architecture, APIs, etc v0.4.0 Plugins and Packages website Tasks related to the projects website / documentation
Projects
None yet
Development

No branches or pull requests

1 participant