Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pr/1838' into 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Janne Karjalainen committed Apr 9, 2021
2 parents aa7d345 + 44c0d0a commit d857ef8
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ app_instance/
webui/app/b2share-bundle.js
webui/app/b2share-bundle.js.map
webui/app/lib/
webui/app/index.html
webui/app/js/
webui/app/vendors/
webui/src/version.js
webui/package-lock.json
webui/package-lock.json
2 changes: 2 additions & 0 deletions webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
},
"dependencies": {
"bootstrap": "^3.3.6",
"clean-webpack-plugin": "^1.0.1",
"dotenv-webpack": "^1.5.7",
"fast-json-patch": "^0.5.6",
"font-awesome": "^4.4.0",
"history": "^3.3.0",
"html-webpack-plugin": "^2.30.1",
"immutable": "^3.7.6",
"lodash": "^4.17.20",
"moment": "^2.29.1",
Expand Down
9 changes: 4 additions & 5 deletions webui/app/index.html → webui/templates/index_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<noscript>
<div>B2SHARE requires JavaScript to be enabled!</div>
</noscript>

<div id="main-container">
<div class="page-wrap">
<div id="body">
Expand Down Expand Up @@ -60,8 +60,7 @@
<div class="col-md-8">
<div id="menu">
<ul>
<li><a href="https://hdl.handle.net/11304/e43b2e3f-83c5-4e3f-b8b7-18d38d37a6cd">EUDAT Service ToU</a></li>
<li><a href="https://hdl.handle.net/11304/e43b2e3f-83c5-4e3f-b8b7-18d38d37a6cd">Terms of Use</a></li>
<li><a href="https://www.eudat.eu/eudat-cdi-aup">Acceptable Use Policy </a></li>
<li><a href="https://eudat.eu/privacy-policy-summary">Data Privacy Statement</a></li>
<li><a href="https://eudat.eu/what-eudat">About EUDAT</a></li>
</ul>
Expand Down Expand Up @@ -93,7 +92,7 @@
</div>
</div>
</div>

<script src="/b2share-bundle.js"></script>
<script type="text/javascript" src="/<%=htmlWebpackPlugin.files.js %>"></script>

</body>
</html>
22 changes: 20 additions & 2 deletions webui/webpack.config.devel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,39 @@ var path = require('path');
var webpack = require('webpack');
const Dotenv = require('dotenv-webpack');
var WatchTimePlugin = require('webpack-watch-time-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');

console.log("Using configuration file from", __dirname+'/../webui.cfg');

let cleanOptions = {
root: __dirname+'/app',
verbose: true,
dry: false
}


module.exports = {
entry: ['./src/main.jsx'],
devtool: 'cheap-module-eval-source-map',
output: { path: __dirname+"/app", filename: 'b2share-bundle.js' },
output: { path: __dirname+"/app/", filename: 'js/b2share-bundle.[hash].js'},
plugins: [
// Note: Only values used in source code will be included in the bundle.
// See dotenv-webpack documentation for more details.
new Dotenv({
path: __dirname+'/../webui.cfg', // load this file instead of '.env'.
systemvars: true, // load environment variables from 'process.env'.
}),
WatchTimePlugin
WatchTimePlugin,
new CleanWebpackPlugin('js', cleanOptions),
//inject false prevents script tag from being automatically injected
//the script tag is injected directly in index_template.html code instead
new HtmlWebpackPlugin({
inject: false,
hash: false,
template: 'templates/index_template.html',
filename: 'index.html'
}),
],
module: {
loaders: [
Expand Down
23 changes: 22 additions & 1 deletion webui/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
var path = require('path');
var webpack = require('webpack');
const Dotenv = require('dotenv-webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');

console.log("Using configuration file from", __dirname+'/../webui.cfg');

let cleanOptions = {
root: __dirname+'/app',
verbose: true,
dry: false
}



module.exports = {
entry: ['./src/main.jsx'],
devtool: 'source-map',
output: { path: __dirname+"/app", filename: 'b2share-bundle.js' },
output: { path: __dirname+"/app/", filename: 'js/b2share-bundle.[hash].js'},
plugins: [
new webpack.DefinePlugin({
'process.env': {
Expand All @@ -22,6 +32,17 @@ module.exports = {
}),
new webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /en/), // trim down moment.js
new webpack.optimize.OccurenceOrderPlugin(),

new CleanWebpackPlugin('js', cleanOptions),

//inject false prevents script tag from being automatically injected
//the script tag is injected directly in index_template.html code instead
new HtmlWebpackPlugin({
inject: false,
hash: false,
template: 'templates/index_template.html',
filename: 'index.html'
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compressor: {
Expand Down

0 comments on commit d857ef8

Please sign in to comment.