deploy: minify JS assets on production

This commit is contained in:
0x1eef 2022-11-10 18:53:17 -03:00 committed by Robert
parent 7c58d7c82e
commit a0600fb49e
3 changed files with 15 additions and 4 deletions

View file

@ -1,3 +1,4 @@
DEPLOY_HOSTNAME=
DEPLOY_USERNAME=
DEPLOY_PATH=
NODE_ENV=

View file

@ -24,14 +24,23 @@ task server: ["nanoc:compile"] do
end
namespace :deploy do
task local: ["nanoc:compile"] do
task local: ["env:development", "nanoc:compile"] do
Deploy::Local.call
end
task remote: ["nanoc:clean", "nanoc:compile"] do
task remote: ["env:production", "nanoc:clean", "nanoc:compile"] do
Deploy::Remote.call
end
end
namespace :env do
task :production do
require "dotenv"
Dotenv.load
Deploy::Remote.call
end
task :development do
ENV["NODE_ENV"] ||= "development"
end
end

View file

@ -1,7 +1,8 @@
const path = require('path');
const process = require('process');
module.exports = {
mode: "development",
mode: process.env.NODE_ENV || "development",
experiments: {
asyncWebAssembly: true
},