-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
add migration guide #1939
add migration guide #1939
Conversation
src/content/guides/migrating.md
Outdated
``` diff | ||
+mode: "development", | ||
``` | ||
|
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.
Also, we can pass mode: none, right?
@EugeneHlushko You may want to add something here? |
src/content/guides/migrating.md
Outdated
|
||
## module.loaders | ||
|
||
`module.loaders` was deprecated since webpack 2 and is now removed in favor of `module.rules`. |
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.
were deprecated
src/content/guides/migrating.md
Outdated
|
||
## json and loaders | ||
|
||
When using a custom loader to transform `.json` files you now need to change the module type: |
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.
type
src/content/guides/migrating.md
Outdated
|
||
## import() and CommonJS | ||
|
||
When using `import()` to load non-ESM the result has changed in webpack 4. You now need access the `default` property to get the value of `module.exports`. |
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.
Now you need to access the default
property to get the value of module.exports
.
non-esm.js
module.exports = {
sayHello: () => { console.log('hello world') }
};
example.js
function sayHello() {
import('./non-esm.js').default.sayHello();
}
sayHello();
src/content/guides/migrating.md
Outdated
|
||
## CommonsChunkPlugin | ||
|
||
The `CommonsChunkPlugin` was removed. Instead the `optimization.splitChunks` options can be used. |
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.
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.
its getting auto formatted, but i suggest adding links to the docs.
src/content/guides/migrating.md
Outdated
|
||
## node.js 4 | ||
|
||
If you are still using node.js 4 or lower, you need to upgrade your node.js installation |
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.
Node.js
sorry for notification spam, didnt use review feature! will push a commit to adress those points i've added |
# Conflicts: # src/content/migrate/3.md
8ee8768
to
7c848bb
Compare
src/content/migrate/3.md
Outdated
@@ -1,6 +1,6 @@ | |||
--- | |||
title: To webpack v2, v3 | |||
sort: 1 | |||
title: To v2, v3 |
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 don't understand previous title, neither this one. It is too cryptic :D
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.
when you open the page it makes sense: https://webpack.js.org/migrate/
@@ -0,0 +1,158 @@ | |||
--- | |||
title: To v4 from v3 |
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.
We should keep titles consistent.
@montogeek updated |
Thanks! |
No description provided.