Discourse uses its own precompile scripts so the config.assets.js_compressor setting has no effects. Discourse (<= 2.7.13) will only start to use terser to compress JS assets under these three conditions:
1. the uglifyjs command exists in $PATH
2. the terser command exists in $PATH
3. SKIP_NODE_UGLIFY environment variable not set
The correct package to install terser with command line tools is the uglifyjs.terser instead of node-terser. Also, the current base image 20.04 only provides an older version of the uglifyjs.terser package which only installs a command called uglifyjs.terser, so manually creating the terser command is required for now.
Discourse uses its own precompile scripts so the config. assets. js_compressor setting has no effects. Discourse (<= 2.7.13) will only start to use terser to compress JS assets under these three conditions:
1. the uglifyjs command exists in $PATH
2. the terser command exists in $PATH
3. SKIP_NODE_UGLIFY environment variable not set
The correct package to install terser with command line tools is the uglifyjs.terser instead of node-terser. Also, the current base image 20.04 only provides an older version of the uglifyjs.terser package which only installs a command called uglifyjs.terser, so manually creating the terser command is required for now.