mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-11 09:11:50 +00:00
Remove unused build variants
Only remove a small amount of code, other changes to build variants are pending.
This commit is contained in:
parent
6695aa0fa0
commit
0f7201c232
@ -1,26 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @type {Record<string, {
|
* @type {Record<string, {
|
||||||
* standalone: boolean,
|
* standalone: boolean
|
||||||
* environment?: 'dev' | 'staging' | 'prod',
|
|
||||||
* electronBaseDir?: string,
|
|
||||||
* executableName?: string
|
|
||||||
* }>}
|
* }>}
|
||||||
*/
|
*/
|
||||||
export const BUILD_VARIANTS = {
|
export const BUILD_VARIANTS = {
|
||||||
"web-localhost": {
|
standalone: {
|
||||||
standalone: false,
|
|
||||||
environment: "dev",
|
|
||||||
},
|
|
||||||
"web-shapezio-beta": {
|
|
||||||
standalone: false,
|
|
||||||
environment: "staging",
|
|
||||||
},
|
|
||||||
"web-shapezio": {
|
|
||||||
standalone: false,
|
|
||||||
environment: "prod",
|
|
||||||
},
|
|
||||||
"standalone": {
|
|
||||||
standalone: true,
|
standalone: true,
|
||||||
executableName: "shapez",
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
57
gulp/js.js
57
gulp/js.js
@ -7,7 +7,6 @@ import webpackConfig from "./webpack.config.js";
|
|||||||
import webpackProductionConfig from "./webpack.production.config.js";
|
import webpackProductionConfig from "./webpack.production.config.js";
|
||||||
|
|
||||||
import webpackStream from "webpack-stream";
|
import webpackStream from "webpack-stream";
|
||||||
import gulpRename from "gulp-rename";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PROVIDES (per <variant>)
|
* PROVIDES (per <variant>)
|
||||||
@ -18,59 +17,27 @@ import gulpRename from "gulp-rename";
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//// DEV
|
// TODO: Move webpack config to build_variants.js and use a separate
|
||||||
|
// build variant for development
|
||||||
export default Object.fromEntries(
|
export default Object.fromEntries(
|
||||||
Object.entries(BUILD_VARIANTS).map(([variant, data]) => {
|
Object.entries(BUILD_VARIANTS).map(([variant, data]) => {
|
||||||
function build() {
|
|
||||||
return gulp
|
|
||||||
.src("../src/js/main.js")
|
|
||||||
.pipe(webpackStream(webpackConfig, webpack))
|
|
||||||
.pipe(gulp.dest(buildFolder));
|
|
||||||
}
|
|
||||||
|
|
||||||
const dev = {
|
const dev = {
|
||||||
build,
|
build() {
|
||||||
|
return gulp
|
||||||
|
.src("../src/js/main.js")
|
||||||
|
.pipe(webpackStream(webpackConfig, webpack))
|
||||||
|
.pipe(gulp.dest(buildFolder));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let prod;
|
const prod = {
|
||||||
if (!data.standalone) {
|
build() {
|
||||||
// WEB
|
|
||||||
|
|
||||||
function transpiled() {
|
|
||||||
return gulp
|
|
||||||
.src("../src/js/main.js")
|
|
||||||
.pipe(webpackStream(webpackProductionConfig, webpack))
|
|
||||||
.pipe(gulpRename("bundle-transpiled.js"))
|
|
||||||
.pipe(gulp.dest(buildFolder));
|
|
||||||
}
|
|
||||||
|
|
||||||
function es6() {
|
|
||||||
return gulp
|
return gulp
|
||||||
.src("../src/js/main.js")
|
.src("../src/js/main.js")
|
||||||
.pipe(webpackStream(webpackProductionConfig, webpack))
|
.pipe(webpackStream(webpackProductionConfig, webpack))
|
||||||
.pipe(gulp.dest(buildFolder));
|
.pipe(gulp.dest(buildFolder));
|
||||||
}
|
},
|
||||||
|
};
|
||||||
prod = {
|
|
||||||
transpiled,
|
|
||||||
es6,
|
|
||||||
build:
|
|
||||||
// transpiled currently not used
|
|
||||||
// gulp.parallel("js." + variant + ".prod.transpiled", "js." + variant + ".prod.es6")
|
|
||||||
es6,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
// STANDALONE
|
|
||||||
function build() {
|
|
||||||
return gulp
|
|
||||||
.src("../src/js/main.js")
|
|
||||||
.pipe(webpackStream(webpackProductionConfig, webpack))
|
|
||||||
.pipe(gulp.dest(buildFolder));
|
|
||||||
}
|
|
||||||
|
|
||||||
prod = { build };
|
|
||||||
}
|
|
||||||
|
|
||||||
return [variant, { dev, prod }];
|
return [variant, { dev, prod }];
|
||||||
})
|
})
|
||||||
|
|||||||
@ -268,12 +268,6 @@ for (const variant in BUILD_VARIANTS) {
|
|||||||
serve[variant] = gulp.series(build.prepare.dev(variant), () => serveHTML({ version: variant }));
|
serve[variant] = gulp.series(build.prepare.dev(variant), () => serveHTML({ version: variant }));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deploying!
|
|
||||||
export const deploy = {
|
|
||||||
staging: gulp.series(utils.requireCleanWorkingTree, build["web-shapezio-beta"].full),
|
|
||||||
prod: gulp.series(utils.requireCleanWorkingTree, build["web-shapezio"].full),
|
|
||||||
};
|
|
||||||
|
|
||||||
export const main = {
|
export const main = {
|
||||||
prepareDocs: docs.prepareDocs,
|
prepareDocs: docs.prepareDocs,
|
||||||
webserver,
|
webserver,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user