Skip to content

Commit

Permalink
#12: Multiple extensions - Chunks with same name may conflict (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Sep 22, 2021
1 parent b3b95ae commit d5f8006
Show file tree
Hide file tree
Showing 9 changed files with 2,919 additions and 5,390 deletions.
2 changes: 1 addition & 1 deletion MapStore2
Submodule MapStore2 updated 811 files
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ The first step to create the plugin is to name it. To do it, you have to edit 3
- Edit `config.js` to change the name of your extension.
- Edit `assets/index.json` and change the "name" entry with the name of your plugin. (here you can customize dependencies, if needed)
- Edit `localConfig.json` replacing "SampleExtension", in `plugins/desktop` section, with the name of your Extension (for running local development)
- Edit `package.json` and change `name` with a unique name, or follow the alternative solution as for #12
- *[only for version <= 2020.01.xx]* Edit `package.json` changing `name` entry with a unique name for your extension. E.g. `mapstore-extension-<ext-name>.`

> **note** Edit the `name` in `package.json` is not strictly needed from version 2021.02.xx. Anyway it is a good practice to choose a unique `name` in your `package.json` for a new npm project, in general.
### Start developing

Expand Down
3 changes: 2 additions & 1 deletion js/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const ConfigUtils = require('@mapstore/utils/ConfigUtils').default;
*/
ConfigUtils.setConfigProp('translationsPath', './MapStore2/web/client/translations');
ConfigUtils.setConfigProp('themePrefix', 'MapStoreExtension');

ConfigUtils.setConfigProp('extensionsRegistry', 'extensions.json');
ConfigUtils.setConfigProp('extensionsFolder', '');
/**
* Use a custom plugins configuration file with:
*
Expand Down
1 change: 1 addition & 0 deletions karma.conf.continuous-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function karmaConfig(config) {
testFile: 'tests.webpack.js',
singleRun: false,
alias: {
"@mapstore/patcher": path.resolve(__dirname, "node_modules", "@mapstore", "patcher"),
"@mapstore": path.resolve(__dirname, "MapStore2", "web", "client"),
"@js": path.resolve(__dirname, "js")
}
Expand Down
1 change: 1 addition & 0 deletions karma.conf.single-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function karmaConfig(config) {
testFile: 'tests.webpack.js',
singleRun: true,
alias: {
"@mapstore/patcher": path.resolve(__dirname, "node_modules", "@mapstore", "patcher"),
"@mapstore": path.resolve(__dirname, "MapStore2", "web", "client"),
"@js": path.resolve(__dirname, "js")
}
Expand Down
8,247 changes: 2,875 additions & 5,372 deletions package-lock.json

Large diffs are not rendered by default.

49 changes: 34 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"babelOptions": {
"configFile": "./MapStore2/build/babel.config.js"
}
},
"globals": {
"__MAPSTORE_PROJECT_CONFIG__": false
}
},
"eslintIgnore": [
Expand All @@ -21,26 +24,42 @@
"web/docs/",
"web/client/mapstore/docs/"
],
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all",
"not IE 11",
"not UCAndroid 12.12"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/core": "7.8.7",
"@babel/runtime": "7.11.2",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/preset-env": "7.8.7",
"@babel/preset-react": "7.8.3",
"@babel/runtime": "7.11.2",
"@geosolutions/acorn-jsx": "4.0.2",
"@geosolutions/jsdoc": "3.4.4",
"@geosolutions/mocha": "6.2.1-3",
"@mapstore/eslint-config-mapstore": "1.0.1",
"@mapstore/eslint-config-mapstore": "1.0.3",
"axios-mock-adapter": "1.16.0",
"babel-istanbul-loader": "0.1.0",
"babel-loader": "8.0.5",
"babel-plugin-add-module-exports": "0.1.4",
"babel-plugin-istanbul": "6.0.0",
"babel-plugin-object-assign": "1.2.1",
"babel-plugin-react-transform": "2.0.2",
"babel-plugin-transform-imports": "2.0.0",
"cesium": "1.17.0",
"copy-webpack-plugin": "^5.1.2",
"css-loader": "0.19.0",
"copy-webpack-plugin": "5.0.2",
"css-loader": "5.1.2",
"css-minimizer-webpack-plugin": "3.0.2",
"denodeify": "1.2.1",
"docma": "1.5.1",
"download-cli": "1.0.1",
Expand All @@ -67,17 +86,17 @@
"karma-mocha": "2.0.1",
"karma-mocha-reporter": "2.2.5",
"karma-sourcemap-loader": "0.3.8",
"karma-webpack": "^5.0.0-alpha.5",
"less": "2.7.1",
"less-loader": "4.1.0",
"mini-css-extract-plugin": "0.5.0",
"karma-webpack": "5.0.0",
"less": "4.1.1",
"less-loader": "8.0.0",
"mini-css-extract-plugin": "1.3.9",
"mkdirp": "0.5.1",
"ncp": "2.0.0",
"parallelshell": "1.2.0",
"postcss": "7.0.14",
"postcss-loader": "3.0.0",
"postcss-prefix-selector": "1.7.1",
"process": "^0.11.10",
"postcss": "8.3.5",
"postcss-loader": "6.1.0",
"postcss-prefix-selector": "1.10.0",
"process": "0.11.10",
"progress-bar-webpack-plugin": "1.12.1",
"raw-loader": "0.5.1",
"react-motion": "0.5.0",
Expand All @@ -90,14 +109,14 @@
"redux-mock-store": "1.2.2",
"rimraf": "2.5.2",
"simple-git": "2.20.1",
"style-loader": "0.12.4",
"style-loader": "2.0.0",
"url-loader": "0.5.7",
"vusion-webfonts-generator": "0.4.1",
"webpack": "5.9.0",
"webpack-bundle-size-analyzer": "2.0.2",
"webpack-cli": "4.5.0",
"webpack-dev-server": "3.11.0",
"zip-webpack-plugin": "^3.0.0"
"zip-webpack-plugin": "3.0.0"
},
"dependencies": {
"mapstore2": "file:MapStore2"
Expand Down
1 change: 1 addition & 0 deletions prod-webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module.exports = require('./MapStore2/build/buildConfig')(
})
],
{
"@mapstore/patcher": path.resolve(__dirname, "node_modules", "@mapstore", "patcher"),
"@mapstore": path.resolve(__dirname, "MapStore2", "web", "client"),
"@js": path.resolve(__dirname, "js")
}
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ module.exports = require('./MapStore2/build/buildConfig')(
'.MapStoreExtension',
[],
{
"@mapstore/patcher": path.resolve(__dirname, "node_modules", "@mapstore", "patcher"),
"@mapstore": path.resolve(__dirname, "MapStore2", "web", "client"),
"@js": path.resolve(__dirname, "js")
}
Expand Down

0 comments on commit d5f8006

Please sign in to comment.