Skip to content

Commit

Permalink
Update config.
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonrt committed Nov 30, 2024
1 parent 5099d19 commit b992c70
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions rollupAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { externalPathsNPM } from './.rollup/local/externalPathsNPM.js';
// Defines the node-resolve config.
const s_RESOLVE_CONFIG = {
browser: true,
dedupe: ['svelte', '@typhonjs-svelte/lib']
dedupe: ['svelte', '@typhonjs-svelte/runtime-base']
};

// Defines potential output plugins to use conditionally if the .env file indicates the bundles should be
Expand All @@ -26,13 +26,11 @@ const sourcemap = true;

// GenerateDTS options -----------------------------------------------------------------------------------------------

// Provides naive search / replace of bundled declaration file rewriting the re-bundled definitions from
// @typhonjs-svelte/lib. This will alter the JSDoc comments and import symbols.
// Provides naive search / replace of bundled declaration file rewriting the re-bundled definitions. This will alter
// the JSDoc comments and import symbols.
const dtsReplace = {
_svelte_lib_: '_typhonjs_fvtt_svelte_',
_svelte_fvtt_: '_typhonjs_fvtt_svelte_',
'#svelte-fvtt/': '@typhonjs-fvtt/svelte/',
'#svelte-lib/': '@typhonjs-fvtt/svelte/',
'/\\/\\/ <reference.*\\/>': '' // Svelte v4 types currently add triple slash references.
};

Expand All @@ -53,17 +51,7 @@ const filterDiagnostic = (diagnostic, message) =>
(diagnostic.code === 2300 && message === `Duplicate identifier 'DOMRect'.`) ||
(diagnostic.code === 1014 && message === `A rest parameter must be last in a parameter list.`);

// // We don't care about external warning messages for `@typhonjs-svelte/lib` imports.
// const ignorePattern = /^@typhonjs-svelte\/lib/;
//
// const onwarn = (warning, warn) =>
// {
// if (warning.code === 'UNRESOLVED_IMPORT' && ignorePattern.test(warning.exporter)) { return; }
// warn(warning);
// };

// Rollup plugin options for generateDTS.
// const dtsPluginOptions = { bundlePackageExports: true, filterDiagnostic, onwarn, dtsReplace };
const dtsPluginOptions = { bundlePackageExports: true, filterDiagnostic, dtsReplace };

// -------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -167,7 +155,6 @@ for (const appFile of appFiles)

fileData = fileData.replaceAll('#runtime/', '@typhonjs-svelte/runtime-base/');
fileData = fileData.replaceAll('#svelte-fvtt/', '@typhonjs-fvtt/svelte/');
fileData = fileData.replaceAll('#svelte-lib/', '@typhonjs-fvtt/svelte/');
fileData = fileData.replaceAll('\'#svelte', '\'svelte');

// For types
Expand All @@ -187,11 +174,8 @@ for (const compFile of compFiles)
{
let fileData = fs.readFileSync(compFile, 'utf-8').toString();

fileData = fileData.replaceAll('@typhonjs-svelte/lib/', '@typhonjs-fvtt/svelte/');

fileData = fileData.replaceAll('#runtime/', '@typhonjs-svelte/runtime-base/');
fileData = fileData.replaceAll('#svelte-fvtt/', '@typhonjs-fvtt/svelte/');
fileData = fileData.replaceAll('#svelte-lib/', '@typhonjs-fvtt/svelte/');
fileData = fileData.replaceAll('\'#svelte', '\'svelte');

// For types
Expand All @@ -210,11 +194,8 @@ for (const gsapFile of gsapFiles)
{
let fileData = fs.readFileSync(gsapFile, 'utf-8').toString();

fileData = fileData.replaceAll('@typhonjs-svelte/lib/', '@typhonjs-fvtt/svelte/');

fileData = fileData.replaceAll('#runtime/', '@typhonjs-svelte/runtime-base/');
fileData = fileData.replaceAll('#svelte-fvtt/', '@typhonjs-fvtt/svelte/');
fileData = fileData.replaceAll('#svelte-lib/', '@typhonjs-fvtt/svelte/');
fileData = fileData.replaceAll('\'#svelte', '\'svelte');

// For types
Expand Down

0 comments on commit b992c70

Please sign in to comment.