Skip to content

Commit

Permalink
chore: update lock
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Dec 22, 2024
1 parent ac486b9 commit 4522637
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
30 changes: 27 additions & 3 deletions packages/core/src/asset/assetConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,39 @@ export const composeAssetConfig = (
return {
output: {
dataUriLimit: 0, // default: no inline asset
// assetPrefix: 'auto', // TODO: will turn on this with js support together in the future
assetPrefix: 'auto', // TODO: will turn on this with js support together in the future
},
tools: {
// rspack: {
// module: {
// generator: {
// asset: {
// // publicPath: 'auto',
// // experimentalLibPreserveImport: true,
// },
// },
// },
// },
},
};
}

// TODO: bundleless
return {
output: {
dataUriLimit: 0, // default: no inline asset
// assetPrefix: 'auto', // TODO: will turn on this with js support together in the future
assetPrefix: 'auto',
},
tools: {
// rspack: {
// module: {
// generator: {
// asset: {
// // publicPath: 'auto',
// // experimentalLibReExport: true,
// },
// },
// },
// },
},
};
}
Expand Down
14 changes: 10 additions & 4 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -909,9 +909,12 @@ const composeEntryConfig = async (
});

// Filter the glob resolved entry files based on the allowed extensions
const resolvedEntryFiles = globEntryFiles.filter((file) =>
ENTRY_EXTENSIONS_PATTERN.test(file),
);
const resolvedEntryFiles = globEntryFiles;
ENTRY_EXTENSIONS_PATTERN;

// .filter((file) =>
// ENTRY_EXTENSIONS_PATTERN.test(file),
// );

if (resolvedEntryFiles.length === 0) {
throw new Error(`Cannot find ${resolvedEntryFiles}`);
Expand Down Expand Up @@ -1053,7 +1056,10 @@ const composeBundlelessExternalConfig = (
);
} else {
// If it does not match jsExtensionsPattern, we should do nothing, eg: ./foo.png
return callback();
resolvedRequest = resolvedRequest.replace(
/\.[^.]+$/,
jsExtension,
);
}
} else {
resolvedRequest = `${resolvedRequest}${jsExtension}`;
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/css/LibCssExtractPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { RSLIB_CSS_ENTRY_FLAG } from './cssConfig';
import {
ABSOLUTE_PUBLIC_PATH,
AUTO_PUBLIC_PATH,
// BASE_URI,
SINGLE_DOT_PATH_SEGMENT,
} from './libCssExtractLoader';
import { getUndoPath } from './utils';
Expand Down Expand Up @@ -62,14 +63,15 @@ class LibCssExtractPlugin implements Rspack.RspackPluginInstance {
}
}

replace(ABSOLUTE_PUBLIC_PATH, '');
replace(SINGLE_DOT_PATH_SEGMENT, '.');
const undoPath = getUndoPath(
name,
compilation.outputOptions.path!,
false,
);
replace(AUTO_PUBLIC_PATH, undoPath);
replace(`${ABSOLUTE_PUBLIC_PATH}${AUTO_PUBLIC_PATH}`, undoPath);
replace(ABSOLUTE_PUBLIC_PATH, '');
// replace(`${BASE_URI}/`, undoPath);

return replaceSource;
});
Expand Down

0 comments on commit 4522637

Please sign in to comment.