This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1k
refactor(schema,webpack)!: split out webpack and postcss build options #2812
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
βοΈ Deploy Preview for nuxt3-docs canceled. π¨ Explore the source changes: 710942f π Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6218ff5c635dcd000749a227 |
danielroe
added
chore
enhancement
New feature or request
kit
schema
vite
webpack
labels
Jan 19, 2022
danielroe
changed the title
refactor(schema): split out webpack and postcss build options
refactor(kit,schema,webpack): split out webpack and postcss build options
Jan 19, 2022
danielroe
changed the title
refactor(kit,schema,webpack): split out webpack and postcss build options
refactor(schema,webpack)Β±: split out webpack and postcss build options
Jan 19, 2022
danielroe
changed the title
refactor(schema,webpack)Β±: split out webpack and postcss build options
refactor(schema,webpack)!: split out webpack and postcss build options
Jan 19, 2022
danielroe
added
the
π° p2-nice-to-have
Priority 2: nothing is broken but it's worth addressing
label
Jan 20, 2022
We may want to list it into https://github.com/nuxt/framework/discussions/2883 as well |
pi0
reviewed
Feb 25, 2022
const useVite = nuxt.options.vite !== false | ||
const { bundle } = await (useVite ? import('@nuxt/vite-builder') : import('@nuxt/webpack-builder')) | ||
const { bundle } = typeof nuxt.options.builder === 'string' | ||
? await tryImportModule(nuxt.options.builder, { paths: nuxt.options.rootDir }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope this works :D (resolution of tryImportModule is CJS)
pi0
approved these changes
Feb 25, 2022
This was referenced Mar 7, 2022
7 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
3.x
chore
enhancement
New feature or request
kit
π° p2-nice-to-have
Priority 2: nothing is broken but it's worth addressing
schema
vite
webpack
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
resolves nuxt/nuxt#12853
β Type of change
π Description
This PR refactors the webpack bundler implementation out of a class, splits out vite, webpack & postcss options as top-level config items, and changes how you set the builder (
build.builder
can bevite
,webpack
, or a custom object with abundle()
method).It also now shares postcss plugin configuration between webpack & vite, meaning that
cssnano
is added to the vite preset.π Migration steps
Update builder option
If you are using webpack, you will need to update your
nuxt.config
:You will also now need to install the webpack builder separately. Add this to
package.json
:Update postcss plugins
If you have configured your postcss plugins separately, you will now need to do so through a new top-level config option. This will apply to both webpack & vite builders.
π TODO