Skip to content

Commit

Permalink
fix some config options
Browse files Browse the repository at this point in the history
  • Loading branch information
jodeleeuw committed Oct 23, 2024
1 parent 1365dcc commit 81fd767
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/config/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { readFileSync } from "node:fs";
import path from "path";

import commonjs from "@rollup/plugin-commonjs";
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import { defineConfig } from "rollup";
import dts from "rollup-plugin-dts";
Expand Down Expand Up @@ -45,12 +44,17 @@ const makeConfig = ({

/** @type{import("rollup-plugin-esbuild").Options} */
const esBuildPluginOptions = {
loaders: { ".json": "json" },
define: {
__APACITATION__: JSON.stringify(citationData.apa),
__BIBTEXCITATION__: JSON.stringify(citationData.bibtex),
// __APACITATION__: `'${JSON.stringify(citationData.apa)}'`,
// __BIBTEXCITATION__: `'${JSON.stringify(citationData.bibtex)}'`,
__APACITATION__: '"hello"',
__BIBTEXCITATION__: '"world"',
},
};

console.log("esBuildPluginOptions", esBuildPluginOptions);

/** @type{import("@rollup/plugin-commonjs").RollupCommonJSOptions} */
const commonjsPluginOptions = {
extensions: [".js", ".json"],
Expand Down Expand Up @@ -79,7 +83,6 @@ const makeConfig = ({
input,
plugins: [
externals(),
json(),
esbuild({ ...esBuildPluginOptions, target: "node18" }),
commonjs(commonjsPluginOptions),
],
Expand All @@ -106,9 +109,8 @@ const makeConfig = ({
plugins: [
externals({ deps: false }),
resolve({ preferBuiltins: false }),
json(),
commonjs(commonjsPluginOptions),
esbuild({ ...esBuildPluginOptions, target: "esnext" }),
commonjs(commonjsPluginOptions),
],
output: {
file: `${destination}.browser.js`,
Expand All @@ -126,7 +128,6 @@ const makeConfig = ({
plugins: [
externals({ deps: false }),
resolve({ preferBuiltins: false }),
json(),
esbuild({ ...esBuildPluginOptions, target: "es2015", minify: true }),
commonjs(commonjsPluginOptions),
],
Expand Down

0 comments on commit 81fd767

Please sign in to comment.