mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-19 06:29:04 +08:00
only uglifying when building for deployment
This commit is contained in:
parent
7ddd3c216e
commit
c0c0bccc7b
2 changed files with 23 additions and 19 deletions
|
|
@ -41,24 +41,27 @@ task("browserify", function () {
|
|||
//the source files are concatenated together
|
||||
debug: false,
|
||||
});
|
||||
return (
|
||||
b
|
||||
.transform(
|
||||
babelify.configure({
|
||||
presets: ["@babel/preset-env"],
|
||||
plugins: ["@babel/transform-runtime"],
|
||||
})
|
||||
)
|
||||
.bundle()
|
||||
.pipe(source("monkeytype.js"))
|
||||
.pipe(buffer())
|
||||
// .pipe(
|
||||
// uglify({
|
||||
// mangle: false,
|
||||
// })
|
||||
// )
|
||||
.pipe(dest("./public/js"))
|
||||
);
|
||||
let ret = b
|
||||
.transform(
|
||||
babelify.configure({
|
||||
presets: ["@babel/preset-env"],
|
||||
plugins: ["@babel/transform-runtime"],
|
||||
})
|
||||
)
|
||||
.bundle()
|
||||
.pipe(source("monkeytype.js"))
|
||||
.pipe(buffer());
|
||||
|
||||
if (process.argv[4] === "production") {
|
||||
ret = ret.pipe(
|
||||
uglify({
|
||||
mangle: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
ret = ret.pipe(dest("./public/js"));
|
||||
return ret;
|
||||
});
|
||||
|
||||
task("static", function () {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"build": "npx gulp build",
|
||||
"build:live": "npx gulp build --option production",
|
||||
"start:dev": "npm run build && concurrently --kill-others \"npx gulp watch\" \"firebase serve --only hosting\"",
|
||||
"deploy:live": "npm run build && firebase deploy -P live --only hosting"
|
||||
"deploy:live": "npm run build:live && firebase deploy -P live --only hosting"
|
||||
},
|
||||
"engines": {
|
||||
"npm": "8.1.2"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue