mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
This fixes build errors, but warnings are still present. Adds rollup/json plugin back into build chain.
This commit is contained in:
parent
7ca68ea38d
commit
62d34278a3
@ -27,7 +27,7 @@
|
||||
"devDependencies": {
|
||||
"@changesets/changelog-github": "^0.4.7",
|
||||
"@changesets/cli": "^2.25.2",
|
||||
"@jspsych/config": "^1.3.2",
|
||||
"@jspsych/config": "^3.0.0",
|
||||
"husky": "^8.0.2",
|
||||
"import-sort-style-module": "^6.0.0",
|
||||
"lint-staged": "^13.0.3",
|
||||
|
@ -2,6 +2,7 @@ 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";
|
||||
@ -29,7 +30,7 @@ const makeConfig = ({
|
||||
outputOptions = {},
|
||||
globalOptions = {},
|
||||
iifeOutputOptions = {},
|
||||
plugins = [],
|
||||
additionalPlugins = [],
|
||||
isNodeOnlyBuild = false,
|
||||
}) => {
|
||||
const input = "src/index.ts";
|
||||
@ -43,7 +44,7 @@ const makeConfig = ({
|
||||
|
||||
/** @type{import("rollup-plugin-esbuild").Options} */
|
||||
const esBuildPluginOptions = {
|
||||
loaders: { ".json": "json" },
|
||||
//loaders: { ".json": "json" },
|
||||
};
|
||||
|
||||
/** @type{import("@rollup/plugin-commonjs").RollupCommonJSOptions} */
|
||||
@ -73,8 +74,9 @@ const makeConfig = ({
|
||||
...globalOptions,
|
||||
input,
|
||||
plugins: [
|
||||
...plugins,
|
||||
...additionalPlugins,
|
||||
externals(),
|
||||
json(),
|
||||
esbuild({ ...esBuildPluginOptions, target: "node18" }),
|
||||
commonjs(commonjsPluginOptions),
|
||||
],
|
||||
@ -99,11 +101,12 @@ const makeConfig = ({
|
||||
...globalOptions,
|
||||
input,
|
||||
plugins: [
|
||||
...plugins,
|
||||
...additionalPlugins,
|
||||
externals({ deps: false }),
|
||||
resolve({ preferBuiltins: false }),
|
||||
esbuild({ ...esBuildPluginOptions, target: "esnext" }),
|
||||
json(),
|
||||
commonjs(commonjsPluginOptions),
|
||||
esbuild({ ...esBuildPluginOptions, target: "esnext" }),
|
||||
],
|
||||
output: {
|
||||
file: `${destination}.browser.js`,
|
||||
@ -119,9 +122,10 @@ const makeConfig = ({
|
||||
...globalOptions,
|
||||
input,
|
||||
plugins: [
|
||||
...plugins,
|
||||
...additionalPlugins,
|
||||
externals({ deps: false }),
|
||||
resolve({ preferBuiltins: false }),
|
||||
json(),
|
||||
esbuild({ ...esBuildPluginOptions, target: "es2015", minify: true }),
|
||||
commonjs(commonjsPluginOptions),
|
||||
],
|
||||
@ -150,7 +154,7 @@ export const makeRollupConfig = (iifeName) =>
|
||||
outputOptions: {
|
||||
exports: "default",
|
||||
globals: { jspsych: "jsPsychModule" },
|
||||
plugins: [cffToJsonPlugin()],
|
||||
additionalPlugins: [cffToJsonPlugin()],
|
||||
},
|
||||
globalOptions: { external: ["jspsych"] },
|
||||
iifeOutputOptions: { name: iifeName },
|
||||
|
Loading…
Reference in New Issue
Block a user