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