Some improvements to projects ecosystem: aliases, proxy configuration interactive createProject script#3701
Conversation
…, interactive createProject script
| singleRun: true | ||
| singleRun: true, | ||
| alias: { | ||
| "@mapstore": path.resolve(__dirname, "MapStore2", "web", "client") |
There was a problem hiding this comment.
in my opinion could be useful to add also js as alias,
i am doing it in succesfully in a standard project
the same applies for the other config of standard project
| }] : []) | ||
| }, | ||
| devServer: { | ||
| proxy: { |
There was a problem hiding this comment.
I suggest to allow the configuration of the whole dev-server.
https://webpack.js.org/configuration/dev-server/
There was a problem hiding this comment.
Another idea is to replace the last argument with a generic object that override all the previous configurations. This way webpack configuration is fully overridable and extensible.
for instance, something named webpackConfigs
{
devServer: {...},
additionalPlugins: //<-- just for example, this can be future entry that can add webpack plugins to the existing ones. Without having an infinite argument list
plugins: [...] // <-- Completely override webpackPlugins.
..,and so on
}
build/buildConfig.js
Outdated
| const ParallelUglifyPlugin = require("webpack-parallel-uglify-plugin"); | ||
|
|
||
| module.exports = (bundles, themeEntries, paths, extractThemesPlugin, prod, publicPath, cssPrefix, chunks) => ({ | ||
| module.exports = (bundles, themeEntries, paths, extractThemesPlugin, prod, publicPath, cssPrefix, chunks, alias = {}, proxy) => ({ |
There was a problem hiding this comment.
There are a lot of argument. Maybe is useful to document a little bit all the arguments, to avoid the user to re-check every time how these arguments are used.
Description
Improvements to createProject script and project templates:
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Does this PR introduce a breaking change? (check one with "x", remove the other)
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: