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

Switch to webpack v3. #854

Merged
merged 1 commit into from
Jul 12, 2018
Merged

Switch to webpack v3. #854

merged 1 commit into from
Jul 12, 2018

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Jun 22, 2018

There are some sections for webpack v4 which are commented out (and some sections for v3 that would need to be removed). When karma-webpack v4 is official, we may want to switch to version 4.


module.exports = {
/* webpack 4
Copy link
Member

Choose a reason for hiding this comment

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

I believe it should be "webpack 3" - assuming this was left over

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is some preliminary work to use webpack 4 that is commented out. I can remove it, but wanted to preserve it in some commit for when we move to webpack 4. Unfortunately, karma-webpack is not webpack 4 compatible yet.

Copy link
Member

Choose a reason for hiding this comment

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

that is fine. I was just making sure.

/* webpack 4
mode: 'production',
*/
performance: {hints: false},
Copy link
Member

Choose a reason for hiding this comment

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

what does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It suppresses certain warning messages. Webpack, for instance, complains that the proj4 inclusion is large and could be broken into smaller modules, but we want proj4 as it stands, so this is not a useful warning. Rather than see this on every build, this turns those warnings off.

Copy link
Member

Choose a reason for hiding this comment

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

thanks

})
],
/* end webpack 3 */
/* webpack 4
Copy link
Member

Choose a reason for hiding this comment

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

are we keeping commented code for the future work?

karma-base.js Outdated
@@ -342,13 +360,17 @@ module.exports = function (config) {
'jasmine', 'sinon'
],
webpack: {
/* webpack 4
Copy link
Member

Choose a reason for hiding this comment

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

same here.. I thought it should be 3

loader: 'istanbul-instrumenter'
}
];
karma_config.webpack.module.rules.unshift({
Copy link
Member

Choose a reason for hiding this comment

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

what is the difference between preloaders vs unshift?

Copy link
Member

Choose a reason for hiding this comment

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

looks like API change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unshift just adds to the beginning of an array. There are no longer preloaders in webpack 3; you just need to order your loaders correctly. This places the loader first.

alias: base.resolve.alias
};

module.exports = {
/* webpack 4
Copy link
Member

Choose a reason for hiding this comment

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

3?

@@ -19,6 +20,12 @@ var define_plugin = new webpack.DefinePlugin({
});

module.exports = {
/* webpack 4
Copy link
Member

@aashish24 aashish24 Jul 12, 2018

Choose a reason for hiding this comment

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

3 or 4, I would just check on it, not sure if this is intentional or left over comment that we forgot to update.

There are some sections for webpack v4 which are commented out (and some
sections for v3 that would need to be removed).  When karma-webpack v4
is official, we may want to switch to version 4.
@manthey manthey merged commit f4e8749 into master Jul 12, 2018
@manthey manthey deleted the webpack-3 branch July 12, 2018 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants