"scripts": [ { "input": "src/external-module/main.js", "inject": false, "bundleName":…
- User
"scripts": [ { "input": "src/external-module/main.js", "inject": false, "bundleName": "external-module" } ] when I use main.ts to replace main.js will give an error string does not match the pattern of ".[cm]?jsx?$"
- Assistant
The error you are seeing is because the value of the "input" property does not match the specified pattern ".[cm]?jsx?$" when you replace "main.js" with "main.ts".
The pattern ".[cm]?jsx?$" is used to match JavaScript or JSX file extensions, including optional "m" or "c" for .mjs or .cjs extensions, respectively. It does not include TypeScript (.ts) file extensions.
If you want to include TypeScript files, you can modify the pattern to ".[cm]?[tj]sx?$" which will match both JavaScript and TypeScript files:
code"scripts": [ { "input": "src/external-module/main.ts", "inject": false, "bundleName": "external-module" } ]With this change, the "input" property value will match the pattern ".[cm]?[tj]sx?$" and the error should be resolved.