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

add migration guide #1939

Merged
merged 7 commits into from
Jul 23, 2018
Merged

add migration guide #1939

merged 7 commits into from
Jul 23, 2018

Conversation

sokra
Copy link
Member

@sokra sokra commented Mar 21, 2018

No description provided.

``` diff
+mode: "development",
```

Copy link
Member

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?

@montogeek
Copy link
Member

@EugeneHlushko You may want to add something here?


## module.loaders

`module.loaders` was deprecated since webpack 2 and is now removed in favor of `module.rules`.
Copy link
Member

Choose a reason for hiding this comment

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

were deprecated


## json and loaders

When using a custom loader to transform `.json` files you now need to change the module type:
Copy link
Member

Choose a reason for hiding this comment

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

type


## 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`.
Copy link
Member

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();


## CommonsChunkPlugin

The `CommonsChunkPlugin` was removed. Instead the `optimization.splitChunks` options can be used.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

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.


## node.js 4

If you are still using node.js 4 or lower, you need to upgrade your node.js installation
Copy link
Member

Choose a reason for hiding this comment

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

Node.js

@EugeneHlushko
Copy link
Member

sorry for notification spam, didnt use review feature! will push a commit to adress those points i've added

@EugeneHlushko EugeneHlushko self-assigned this Jul 18, 2018
@@ -1,6 +1,6 @@
---
title: To webpack v2, v3
sort: 1
title: To v2, v3
Copy link
Member

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

Copy link
Member

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
Copy link
Member

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.

@EugeneHlushko
Copy link
Member

@montogeek updated

@montogeek montogeek merged commit bdc7fae into master Jul 23, 2018
@montogeek
Copy link
Member

Thanks!

@montogeek montogeek deleted the content/migration-4 branch July 23, 2018 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants