-
Notifications
You must be signed in to change notification settings - Fork 89
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
Webpack improvements #491
Webpack improvements #491
Conversation
- Change [hash] to [contenthash] for the files generated as hash is deprecated. - Move react to 'dependencies' instead of 'devDependencies' in the package.json file. - Update Copy plugin to latest version.
Get the environment from process.env.NODE_ENV
Content/default/webpack.config.js
Outdated
: commonPlugins, | ||
resolve: { | ||
// See https://github.com/fable-compiler/Fable/issues/1490 | ||
symlinks: false |
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.
Does anyone know if this is still needed when not using fable-loader
webpack loader?
Has anyone tried writing their Webpack config in F# yet? 🤪 |
Not yet, but could be interesting. I'm thinking that using anonymous records could be the easiest thing to do. |
Looks good 👍 @Zaid-Ajaj @MangelMaxime can you have a look please? |
All the stuff listed in @tico321 comments seems goods to me. One tips, that I like to use now days for the plugins array is to use plugins:
[
new HtmlWebpackPlugin({
filename: "./index.html",
template: "./src/index.html"
}),
new MiniCssExtractPlugin(),
isProduction && myProductionOnlyPlugin() // This plugin will only be added for production
].filter(Boolean), But it depends on what people find here to read between that and the concat. About the |
Yep, I think I like that. That way you don't have to scroll up to find |
As it looks like we no longer need the |
Is anything preventing the PR from being merged? Please let me know if I missed something |
Sorry, didn't have time to get to this up till now. |
I want to propose the following changes to webpack in order to align with common practices in the JS world. Here is the list of changes:
const
instead ofvar
when possible.devDependencies
anddependencies
in the package.json file.Some additional changes:
[hash]
to[contenthash]
for the mini-css-extract-plugin and for the js output since[hash]
has been deprecated.I'll be happy to hear your feedback on this proposal, so please let me know if anything can be improved.
closes #488