Skip to content

Some improvements to projects ecosystem: aliases, proxy configuration interactive createProject script#3701

Merged
offtherailz merged 3 commits intogeosolutions-it:masterfrom
mbarto:webpack_aliases
May 3, 2019
Merged

Some improvements to projects ecosystem: aliases, proxy configuration interactive createProject script#3701
offtherailz merged 3 commits intogeosolutions-it:masterfrom
mbarto:webpack_aliases

Conversation

@mbarto
Copy link
Copy Markdown
Contributor

@mbarto mbarto commented Apr 19, 2019

Description

Improvements to createProject script and project templates:

  • introduced @mapstore alias for MapStore2 folder
  • introduced configuration option for devserver proxy in webpack cfg for dev mode
  • interactive run for createProject (will ask for params if run without)
  • minor fixes to 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)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@ghost ghost assigned mbarto Apr 19, 2019
@mbarto mbarto requested a review from allyoucanmap April 19, 2019 10:49
@coveralls
Copy link
Copy Markdown

coveralls commented Apr 19, 2019

Coverage Status

Coverage decreased (-0.03%) to 81.179% when pulling 81811ba on mbarto:webpack_aliases into aeb28d5 on geosolutions-it:master.

singleRun: true
singleRun: true,
alias: {
"@mapstore": path.resolve(__dirname, "MapStore2", "web", "client")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@geosolutions-it geosolutions-it deleted a comment Apr 19, 2019
Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

Fine, only a couple of suggestion to make it even more extensible and maintainable

}] : [])
},
devServer: {
proxy: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suggest to allow the configuration of the whole dev-server.
https://webpack.js.org/configuration/dev-server/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
}

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) => ({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@tdipisa tdipisa added this to the 2019.02.00 milestone Apr 29, 2019
@geosolutions-it geosolutions-it deleted a comment Apr 29, 2019
@offtherailz offtherailz merged commit a248afe into geosolutions-it:master May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants