Skip to content

Commit 24adf1c

Browse files
authored
docs: add library config changes to migration guide (#7175)
As far as I can tell this is so far only mentioned in this issue comment (it seems to have changed after the blog post listing all the changes in config): webpack/webpack#13584 (comment) I also needed this question and answer to figure it out: https://stackoverflow.com/questions/77951581/webpack-5-builds-for-aws-lambda-with-typescript-runtime-handlernotfound
1 parent cec21a9 commit 24adf1c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/content/migrate/5.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,28 @@ If you were not able to upgrade some plugins/loaders to the latest in Upgrade we
126126
}
127127
```
128128

129+
- If you have output.library or output.libraryTarget defined, change the property names: (output.libraryTarget -> output.library.type, output.library -> output.library.name). Example
130+
131+
```json
132+
// for webpack 4
133+
{
134+
output: {
135+
library: 'MyLibrary',
136+
libraryTarget: 'commonjs2'
137+
}
138+
}
139+
140+
// for webpack 5
141+
{
142+
output: {
143+
library: {
144+
name: 'MyLibrary',
145+
type: 'commonjs2'
146+
}
147+
}
148+
}
149+
```
150+
129151
If you were using WebAssembly via import, you should follow this two step process:
130152

131153
- Enable the deprecated spec by setting `experiments.syncWebAssembly: true`, to get the same behavior as in webpack 4.

0 commit comments

Comments
 (0)