message: changed terser options
diff: @@ -2,6 +2,13 @@ import textLoader from "../loaders/text.js";
  import minify from "../deps/terser.js";
  import { basename } from "../deps/path.js";
  +// default options
  +const defaults = {
  + module: true,
  + compress: true,
  + mangle: true,
  +};
  +
  export default function (options = {}) {
  return (site) => {
  site.loadAssets([".js"], textLoader);
  @@ -11,25 +18,18 @@ export default function (options = {}) {
  const content = file.content;
  const filename = file.dest.path + file.dest.ext;
  - // default options
  - const defaults = {
  - module: true,
  - compress: true,
  - mangle: true,
  - };
  -
  - // merge user-defined options
  - options = { ...defaults, ...options };
  + // options passed to terser
  + const terserOptions = { ...defaults, ...options.options };
  - if (options.sourceMap) {
  - options.sourceMap = {
  + if (options.map) {
  + terserOptions.sourceMap = {
  filename: filename,
  // filename is path, so just need basename
  url: basename(filename) + ".map",
  };
  }
  - const output = await minify(content, options);
  + const output = await minify(content, terserOptions);
  file.content = output.code;
  