Skip to content

Commit

Permalink
Allow building client in GALAXY_STATIC_ROOT/static
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed May 8, 2019
1 parent 3dbab3d commit fa0619a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require("path");
const fs = require("fs");
const del = require("del");
const { src, dest, series, parallel } = require("gulp");
const staticRoot = process.env.GALAXY_STATIC_ROOT ? process.env.GALAXY_STATIC_ROOT : '..';

const paths = {
node_modules: "./node_modules",
Expand Down Expand Up @@ -47,16 +48,16 @@ function stageLibs(callback) {

function fonts() {
return src(path.resolve(path.join(paths.node_modules, "font-awesome/fonts/**/*"))).pipe(
dest("../static/images/fonts")
dest(staticRoot + "/static/images/fonts")
);
}

function stagePlugins() {
return src(paths.plugin_dirs).pipe(dest("../static/plugins/"));
return src(paths.plugin_dirs).pipe(dest(staticRoot + "/static/plugins/"));
}

function cleanPlugins() {
return del(["../static/plugins/{visualizations,interactive_environments}/*"], { force: true });
return del([staticRoot + "/static/plugins/{visualizations,interactive_environments}/*"], { force: true });
}

module.exports.fonts = fonts;
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"webpack-production": "webpack -p",
"webpack-production-maps": "GXY_BUILD_SOURCEMAPS=1 webpack -p",
"gulp": "gulp",
"save-build-hash": "(git rev-parse HEAD 2>/dev/null || echo '') >../static/client_build_hash.txt",
"save-build-hash": "(git rev-parse HEAD 2>/dev/null || echo '') >${GALAXY_STATIC_ROOT:-..}/static/client_build_hash.txt",
"build-charts": "webpack -p --config ../config/plugins/visualizations/charts/webpack.config.js",
"build-scatterplot": "NODE_PATH=./node_modules webpack -p --config ../config/plugins/visualizations/scatterplot/webpack.config.js",
"prettier": "prettier --write 'galaxy/style/scss/**/*.scss' 'galaxy/scripts/**/{*.js,*.vue}' '!galaxy/scripts/libs/**'",
Expand Down
5 changes: 3 additions & 2 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const DuplicatePackageCheckerPlugin = require("duplicate-package-checker-webpack
const scriptsBase = path.join(__dirname, "galaxy/scripts");
const libsBase = path.join(scriptsBase, "libs");
const styleBase = path.join(__dirname, "galaxy/style");
const imageBase = path.join(__dirname, "../static/style");
const staticRoot = process.env.GALAXY_STATIC_ROOT ? path.join(process.env.GALAXY_STATIC_ROOT, 'x/') : __dirname;
const imageBase = path.join(staticRoot, "../static/style");

let buildconfig = {
entry: {
Expand All @@ -19,7 +20,7 @@ let buildconfig = {
generic: ["polyfills", "bundleEntries", "entry/generic"]
},
output: {
path: path.join(__dirname, "../", "static/scripts/bundled"),
path: path.join(staticRoot, "../", "static/scripts/bundled"),
publicPath: "/static/scripts/bundled/",
filename: "[name].bundled.js",
chunkFilename: "[name].chunk.js"
Expand Down

0 comments on commit fa0619a

Please sign in to comment.