mirror of
https://github.com/psychopy/psychojs.git
synced 2025-05-10 10:40:54 +00:00
scripts: fix for dprint
This commit is contained in:
parent
3d635cc355
commit
a8c4b46ae8
@ -1,13 +1,13 @@
|
|||||||
const { buildSync } = require('esbuild');
|
const { buildSync } = require("esbuild");
|
||||||
const pkg = require('psychojs/package.json');
|
const pkg = require("psychojs/package.json");
|
||||||
|
|
||||||
const versionMaybe = process.env.npm_config_outver;
|
const versionMaybe = process.env.npm_config_outver;
|
||||||
const dirMaybe = process.env.npm_config_outdir;
|
const dirMaybe = process.env.npm_config_outdir;
|
||||||
const [,,, dir = dirMaybe || 'out', version = versionMaybe || pkg.version] = process.argv;
|
const [, , , dir = dirMaybe || "out", version = versionMaybe || pkg.version] = process.argv;
|
||||||
|
|
||||||
buildSync({
|
buildSync({
|
||||||
bundle: true,
|
bundle: true,
|
||||||
entryPoints: ['src/index.css'],
|
entryPoints: ["src/index.css"],
|
||||||
minify: true,
|
minify: true,
|
||||||
outfile: `./${dir}/psychojs-${version}.css`
|
outfile: `./${dir}/psychojs-${version}.css`,
|
||||||
});
|
});
|
||||||
|
@ -1,24 +1,25 @@
|
|||||||
const { buildSync } = require('esbuild');
|
const { buildSync } = require("esbuild");
|
||||||
const pkg = require('psychojs/package.json');
|
const pkg = require("psychojs/package.json");
|
||||||
|
|
||||||
const versionMaybe = process.env.npm_config_outver;
|
const versionMaybe = process.env.npm_config_outver;
|
||||||
const dirMaybe = process.env.npm_config_outdir;
|
const dirMaybe = process.env.npm_config_outdir;
|
||||||
const [,,, dir = dirMaybe || 'out', version = versionMaybe || pkg.version] = process.argv;
|
const [, , , dir = dirMaybe || "out", version = versionMaybe || pkg.version] = process.argv;
|
||||||
|
|
||||||
[
|
[
|
||||||
// The ESM bundle
|
// The ESM bundle
|
||||||
{
|
{
|
||||||
format: 'esm',
|
format: "esm",
|
||||||
legalComments: 'external',
|
legalComments: "external",
|
||||||
outfile: `./${dir}/psychojs-${version}.js`,
|
outfile: `./${dir}/psychojs-${version}.js`,
|
||||||
},
|
},
|
||||||
// The IIFE
|
// The IIFE
|
||||||
{
|
{
|
||||||
globalName: 'PsychoJS',
|
globalName: "PsychoJS",
|
||||||
legalComments: 'none',
|
legalComments: "none",
|
||||||
outfile: `./${dir}/psychojs-${version}.iife.js`
|
outfile: `./${dir}/psychojs-${version}.iife.js`,
|
||||||
}
|
},
|
||||||
].forEach(function(options) {
|
].forEach(function(options)
|
||||||
|
{
|
||||||
buildSync({ ...this, ...options });
|
buildSync({ ...this, ...options });
|
||||||
}, {
|
}, {
|
||||||
// Shared options
|
// Shared options
|
||||||
@ -27,12 +28,12 @@ const [,,, dir = dirMaybe || 'out', version = versionMaybe || pkg.version] = pro
|
|||||||
},
|
},
|
||||||
bundle: true,
|
bundle: true,
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
entryPoints: ['src/index.js'],
|
entryPoints: ["src/index.js"],
|
||||||
minifySyntax: true,
|
minifySyntax: true,
|
||||||
minifyWhitespace: true,
|
minifyWhitespace: true,
|
||||||
target: [
|
target: [
|
||||||
// https://github.com/evanw/esbuild/issues/121#issuecomment-646956379
|
// https://github.com/evanw/esbuild/issues/121#issuecomment-646956379
|
||||||
'es2017',
|
"es2017",
|
||||||
'node14',
|
"node14",
|
||||||
]
|
],
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user