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

Update webpack to 4.0.0 #41

Merged
merged 6 commits into from Mar 12, 2018
Merged

Update webpack to 4.0.0 #41

merged 6 commits into from Mar 12, 2018

Conversation

flut1
Copy link
Collaborator

@flut1 flut1 commented Feb 26, 2018

I updated everything to make the build and dev commands work without error. However, we should thoroughly review the new configuration before merging. Particularly:

  • the mode: 'development' and mode: 'production' provide a lot of default config for us. This might allow us to remove some of our existing config.
  • CommonsChunkPlugin has been replaced with the optimization config. I am now using the default configuration for that. We should verify if that is what we want. See https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693
  • Same as above for the uglify plugin. We also need to check if the default options suffice
  • Added an alpha version of extract-text-webpack-plugin. We might want to wait for stable
  • We should check if there are any new webpack options we want to take advantage of

@flut1
Copy link
Collaborator Author

flut1 commented Feb 26, 2018

There are some issues with awesome-typescript-loader that need to be resolved first. See s-panferov/awesome-typescript-loader#534

chunks: 'all'
},
runtimeChunk: true
},
plugins: [
new WebpackCleanupPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
'process.env': env,
}),
new webpack.NamedChunksPlugin(),

Choose a reason for hiding this comment

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

This one is automatically on in development mode, so can be removed.

Copy link

@ThaNarie ThaNarie Feb 26, 2018

Choose a reason for hiding this comment

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

Ah wait, this is prod, maybe we want to leave it on here :) (but can be removed from dev config)

NamedModulesPlugin -> optimization.namedModules (on by default in develoment mode)

@ThaNarie
Copy link

ThaNarie commented Feb 26, 2018

webpack.NoEmitOnErrorsPlugin can also be removed if i'm correct.

NoEmitOnErrorsPlugin -> optimization.noEmitOnErrors (on by default in production mode)

@ThaNarie
Copy link

Not sure if we want this, but:

Resolving can now be configured with module.rules[].resolve. It's merged with the global configuration.

So we could add .vue resolve in the vue loader config, so if you disable the loader rules, the resolving also will be removed. Best practices and all..

@ThaNarie
Copy link

ModuleConcatenationPlugin -> optimization.concatenateModules (on by default in production mode)

So we can remove this one as well

Floris Bernard added 3 commits March 7, 2018 11:13
Remove lib config from tsconfig.json for now because it is still has
issues in awesome-typescript-loader
@flut1
Copy link
Collaborator Author

flut1 commented Mar 7, 2018

I implemented the suggestions by @ThaNarie above.
Updated awesome-typescript-loader to 5.0.0-0, which fixes most issues. However, there is still a problem with the "lib" option in tsconfig.json. I removed it for now, because we seem te be using the default anway

Revert the change to tsconfig.json. It is no longer needed because
the underlying issue has been fixed in awesome-typescript-loader
@flut1
Copy link
Collaborator Author

flut1 commented Mar 9, 2018

@hjeti I fixed the TS issues (see latest commit). As far as I know this can be safely merged. It might be good though for someone to test these changes more extensively (for example, apply them in an existing project)

@flut1
Copy link
Collaborator Author

flut1 commented Mar 9, 2018

Just tested it by applying the changes to an existing project. All worked fine (tested dev server and prod build).

@hjeti hjeti merged commit 89f81c7 into hjeti:master Mar 12, 2018
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.

None yet

3 participants