forked from geosolutions-it/geonode-mapstore-client
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove themes and switch to standard mapstore project (#449)
- Loading branch information
1 parent
a6f593f
commit cc60405
Showing
19 changed files
with
119 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
module.exports = (devServerDefault, projectConfig) => { | ||
|
||
const appDirectory = projectConfig.appDirectory; | ||
const envPath = path.resolve(appDirectory, 'env.json'); | ||
const envJson = fs.existsSync(envPath) ? require(envPath) : {}; | ||
const packageJSON = require(path.resolve(appDirectory, 'package.json')) || {}; | ||
const geoNodeProjectConfig = packageJSON.geonode || {}; | ||
const devServerOptions = geoNodeProjectConfig.devServer || {}; | ||
const devServerHost = devServerOptions.host || envJson.DEV_SERVER_HOST || 'localhost'; | ||
const proxyTargetHost = devServerOptions.proxyTargetHost || envJson.DEV_SERVER_PROXY_TARGET_HOST || 'localhost:8000'; | ||
const protocol = devServerOptions.protocol || envJson.DEV_SERVER_HOST_PROTOCOL || 'http'; | ||
|
||
return { | ||
clientLogLevel: 'debug', | ||
https: protocol === 'https' ? true : false, | ||
host: devServerHost, | ||
headers: { | ||
'Access-Control-Allow-Origin': '*' | ||
}, | ||
contentBase: [ | ||
path.join(appDirectory) | ||
], | ||
before: function(app) { | ||
const hashRegex = /\.[a-zA-Z0-9]{1,}\.js/; | ||
app.use(function(req, res, next) { | ||
// remove hash from requests to use the local js | ||
const appsName = [ | ||
...(projectConfig.apps || []) | ||
] | ||
.find(name => req.url.indexOf('/' + name) !== -1 ); | ||
if (appsName) { | ||
req.url = req.url.replace(hashRegex, '.js'); | ||
req.path = req.path.replace(hashRegex, '.js'); | ||
req.originalUrl = req.originalUrl.replace(hashRegex, '.js'); | ||
} | ||
next(); | ||
}); | ||
}, | ||
proxy: [ | ||
{ | ||
context: [ | ||
'**', | ||
'!**/static/mapstore/**', | ||
'!**/MapStore2/**', | ||
'!**/node_modules/**' | ||
], | ||
target: `${protocol}://${proxyTargetHost}`, | ||
headers: { | ||
Host: proxyTargetHost, | ||
Referer: `${protocol}://${proxyTargetHost}/` | ||
} | ||
}, | ||
{ | ||
context: [ | ||
'/static/mapstore/ms-translations/**', | ||
'/static/mapstore/gn-translations/**' | ||
], | ||
target: `${protocol}://${devServerHost}:8081`, | ||
secure: false, | ||
changeOrigin: true, | ||
pathRewrite: { | ||
'/static/mapstore/ms-translations': '/node_modules/mapstore/web/client/translations', | ||
'/static/mapstore/gn-translations': '/static/mapstore/translations' | ||
} | ||
} | ||
] | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 0 additions & 147 deletions
147
geonode_mapstore_client/client/themes/default/less/geonode.less
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
geonode_mapstore_client/client/themes/default/variables.less
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.