Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,15 @@ const composeFormatConfig = ({
}

const config: EnvironmentConfig = {
output: {
minify: {
jsOptions: {
minimizerOptions: {
module: true,
},
},
},
},
tools: {
rspack: {
module: {
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/iife/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ test('iife', async () => {
"(()=>{
"use strict";
const external_globalHelper_namespaceObject = globalThis.globalHelper;
const addPrefix = (prefix, str, env)=>\`\${env}: \${prefix}\${str}\`;
const addPrefix = (prefix, str, env)=>{
console.log(import.meta.dirname);
return \`\${env}: \${prefix}\${str}\`;
};
globalThis.addPrefix = (str)=>addPrefix(external_globalHelper_namespaceObject.helperName, str, "production");
})();
"
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/iife/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const addPrefix = (prefix: string, str: string, env: string) =>
`${env}: ${prefix}${str}`;
const addPrefix = (prefix: string, str: string, env: string): string => {
console.log(import.meta.dirname);
return `${env}: ${prefix}${str}`;
};

export { addPrefix };
Loading