Skip to content

Commit

Permalink
Add .js esm output
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Oct 11, 2019
1 parent ebbd6e8 commit 8df2c46
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import typescript from "rollup-plugin-typescript2";
import { terser } from "rollup-plugin-terser";

function config({ format, minify, input }) {
function config({ format, minify, input, ext = "js" }) {
const dir = `dist/${format}/`;
const minifierSuffix = minify ? ".min" : "";
const ext = format === "esm" ? "mjs" : "js";
return {
input: `./src/${input}.ts`,
output: {
Expand Down Expand Up @@ -40,12 +39,14 @@ function config({ format, minify, input }) {
require("rimraf").sync("dist");

export default [
{ input: "comlink", format: "esm", minify: false, ext: "mjs" },
{ input: "comlink", format: "esm", minify: true, ext: "mjs" },
{ input: "comlink", format: "esm", minify: false },
{ input: "comlink", format: "esm", minify: true },
{ input: "comlink", format: "umd", minify: false },
{ input: "comlink", format: "umd", minify: true },
{ input: "node-adapter", format: "esm", minify: false },
{ input: "node-adapter", format: "esm", minify: true },
{ input: "node-adapter", format: "esm", minify: false, ext: "mjs" },
{ input: "node-adapter", format: "esm", minify: true, ext: "mjs" },
{ input: "node-adapter", format: "umd", minify: false },
{ input: "node-adapter", format: "umd", minify: true }
].map(config);

0 comments on commit 8df2c46

Please sign in to comment.