Last active
July 7, 2025 16:19
-
-
Save arvidfm/350eb8bdb328b0e70fec2eeea240a6df to your computer and use it in GitHub Desktop.
Webpack commonjs-static bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function main() { | |
const a = [1, 2, 3]; | |
// remove the below line to avoid the issue | |
const b = [4, 5, 6, ...a]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "webpack-test", | |
"version": "1.0.0", | |
"description": "", | |
"private": true, | |
"sideEffects": false, | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"ts-loader": "9.5.2", | |
"typescript": "5.0.4", | |
"webpack": "5.99.8", | |
"webpack-cli": "6.0.1" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: `./src/index.ts`, | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
use: 'ts-loader', | |
}, | |
], | |
}, | |
mode: 'development', | |
output: { | |
library: { | |
type: 'commonjs-static', | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment