From 2454a96eaa03e8295142a2895b74b8698bdae689 Mon Sep 17 00:00:00 2001 From: Taye Adeyemi Date: Mon, 4 Dec 2023 20:36:30 +0100 Subject: [PATCH] chore: fix build issues --- scripts/bin/bundle_shims.js | 5 +---- scripts/bin/release.js | 4 ++-- scripts/bundler.js | 8 ++++++-- scripts/shimBundler.js | 4 +++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/bin/bundle_shims.js b/scripts/bin/bundle_shims.js index 9d2846cfc..5f4670c11 100644 --- a/scripts/bin/bundle_shims.js +++ b/scripts/bin/bundle_shims.js @@ -1,13 +1,10 @@ const os = require('os') -const path = require('path') const { default: PQueue } = require('p-queue') const bundleShim = require('../shimBundler') const { getShims, errorExit } = require('../utils') -const destDir = path.join(__dirname, '..', 'dist', 'shims') - const queue = new PQueue({ concurrency: os.cpus().length }) const shims = getShims() @@ -23,7 +20,7 @@ async function bundle(shimConfig) { console.log(`Bundling ${source}`) - await bundleShim({ ...shimConfig, destDir }) + await bundleShim({ ...shimConfig }) } queue.onIdle().then((bundled) => { diff --git a/scripts/bin/release.js b/scripts/bin/release.js index f5bf3699c..71b9fe744 100644 --- a/scripts/bin/release.js +++ b/scripts/bin/release.js @@ -96,7 +96,7 @@ async function runBuild() { // bundle interactjs shell.exec('npm run build:bundle') // ensure that the output is valid ES5 syntax - shell.exec('acord --silent --ecma5 packages/interactjs/dist/**/*.js') + shell.exec('acorn --silent --ecma5 packages/interactjs/dist/**/*.js') // generate docs shell.exec('npm run build:docs') @@ -120,7 +120,7 @@ async function runBuild() { function commit() { // commit and add new version tag shell.exec('git add --all .') - shell.exec('git add --force packages dist/docs') + shell.exec('git add --force packages dist/api') shell.exec('git reset **/node_modules') shell.exec(`git commit --no-verify -m ${gitTag}`) } diff --git a/scripts/bundler.js b/scripts/bundler.js index 93b382373..4665391a4 100644 --- a/scripts/bundler.js +++ b/scripts/bundler.js @@ -44,8 +44,12 @@ const createRollupConfigs = async ({ { babelrc: false, configFile: false, - browserslistConfigFile: false, - targets: format === 'es' ? undefined : { ie: 9 }, + ...(format === 'es' + ? {} + : { + browserslistConfigFile: false, + targets: { ie: 9 }, + }), babelHelpers: 'bundled', skipPreflightCheck: true, extensions: ['.ts', '.tsx', '.js', '.jsx', '.vue'], diff --git a/scripts/shimBundler.js b/scripts/shimBundler.js index b926627c3..94024e66c 100644 --- a/scripts/shimBundler.js +++ b/scripts/shimBundler.js @@ -7,7 +7,9 @@ const { getModuleDirectories } = require('./utils') const moduleDirectory = getModuleDirectories() -module.exports = async ({ source, destDir }) => { +const destDir = path.join(__dirname, '..', 'dist', 'shims') + +module.exports = async ({ source }) => { const sourcePath = resolveSync(source, { moduleDirectory, extensions: ['.ts', '.tsx', '.js', '.jsx'],