Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Allow usage of multiple same plugins, map mains to html plugins #509

Merged
merged 1 commit into from Dec 2, 2017
Merged

Allow usage of multiple same plugins, map mains to html plugins #509

merged 1 commit into from Dec 2, 2017

Conversation

eliperelman
Copy link
Member

Fixes #326.

This is a breaking change because it removes the html plugin from the web preset and replaces it with html-index.

@eliperelman eliperelman added this to the v8 milestone Dec 2, 2017
@eliperelman eliperelman self-assigned this Dec 2, 2017
@eliperelman eliperelman requested a review from a team December 2, 2017 00:50
@eliperelman eliperelman merged commit 9380f02 into neutrinojs:master Dec 2, 2017
neutrino.use(htmlTemplate, merge({
pluginId: `html-${key}`,
filename: `${key}.html`,
chunks: [key, 'vendor', 'runtime']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment here and to packages/chunk/index.js saying the two sets of chunk names need to be kept in sync?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing!

@@ -340,7 +339,7 @@ _Note: Some plugins are only available in certain environments. To override them
| `env` | Inject environment variables into source code at `process.env`, defaults to only inject `NODE_ENV`. From `@neutrinojs/env`. | all |
| `extract` | Extracts CSS from JS bundle into a separate stylesheet file. From `@neutrinojs/style-loader`. | all |
| `extract-modules` | Extracts CSS from JS bundle into a separate stylesheet file. From `@neutrinojs/style-loader`. | all |
| `html` | Automatically generates HTML files for configured entry points. From `@neutrinojs/html-template` | all |
| `html-{MAIN_NAME}` | Automatically generates HTML files for configured entry points. `{MAIN_NAME}` corresponds to the entry point of each page. By default, there is only a single `index` main, so this would generate a plugin named `html-index`. From `@neutrinojs/html-template` | all |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea on making this breaking change, I think it will result in much less confusion long term for different naming forms for single and multi mains projects.

@timkelty
Copy link
Contributor

timkelty commented Dec 6, 2017

@eliperelman something's not right here…in master's current state, neutrino build is not creating any html files.

Looking at the changes here, it indeed appears that htmlTemplate is only getting added in start: https://github.com/eliperelman/neutrino-dev/blob/420bdac667b03798f358f49c54479ab69d6b1039/packages/web/index.js#L156-L171

@eliperelman
Copy link
Member Author

@timkelty yikes, great catch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants