mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-09 16:21:51 +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, {
|
||||
* standalone: boolean,
|
||||
* environment?: 'dev' | 'staging' | 'prod',
|
||||
* electronBaseDir?: string,
|
||||
* executableName?: string
|
||||
* standalone: boolean
|
||||
* }>}
|
||||
*/
|
||||
export const BUILD_VARIANTS = {
|
||||
"web-localhost": {
|
||||
standalone: false,
|
||||
environment: "dev",
|
||||
},
|
||||
"web-shapezio-beta": {
|
||||
standalone: false,
|
||||
environment: "staging",
|
||||
},
|
||||
"web-shapezio": {
|
||||
standalone: false,
|
||||
environment: "prod",
|
||||
},
|
||||
"standalone": {
|
||||
standalone: {
|
||||
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 webpackStream from "webpack-stream";
|
||||
import gulpRename from "gulp-rename";
|
||||
|
||||
/**
|
||||
* 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(
|
||||
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 = {
|
||||
build,
|
||||
build() {
|
||||
return gulp
|
||||
.src("../src/js/main.js")
|
||||
.pipe(webpackStream(webpackConfig, webpack))
|
||||
.pipe(gulp.dest(buildFolder));
|
||||
},
|
||||
};
|
||||
|
||||
let prod;
|
||||
if (!data.standalone) {
|
||||
// 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() {
|
||||
const prod = {
|
||||
build() {
|
||||
return gulp
|
||||
.src("../src/js/main.js")
|
||||
.pipe(webpackStream(webpackProductionConfig, webpack))
|
||||
.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 }];
|
||||
})
|
||||
|
||||
@ -268,12 +268,6 @@ for (const variant in BUILD_VARIANTS) {
|
||||
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 = {
|
||||
prepareDocs: docs.prepareDocs,
|
||||
webserver,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user