Skip to content

Conversation

@mcost45
Copy link
Contributor

@mcost45 mcost45 commented Sep 2, 2025

Description

This is a small change that includes the insertion of the /* @vite-ignore */ magic comment within the build.ts postProcess function, alongside /* webpackIgnore:true */, for dynamic imports.

/* @vite-ignore */ suppresses a Vite warning:

The above dynamic import cannot be analyzed by Vite. See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

, and does not change other behaviour. Note that it must be included as a separate, distinct comment to match the regexp.

Motivation and Context

Resolves #25918. The Vite magic comment should be included because the dynamic imports are intended 'to be left as-is', and the warning cannot otherwise be disabled by an end-user (myself in an Angular project).

@mcost45
Copy link
Contributor Author

mcost45 commented Sep 2, 2025

@microsoft-github-policy-service agree

Copy link
Contributor

@fs-eire fs-eire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the contribution! please resolve the comments

@fs-eire
Copy link
Contributor

fs-eire commented Sep 2, 2025

please also modify implementation of function dynamicImportDefault in js\web\lib\wasm\wasm-utils-import.ts

@mcost45
Copy link
Contributor Author

mcost45 commented Sep 3, 2025

Thanks @fs-eire, I have made the requested changes.

@fs-eire
Copy link
Contributor

fs-eire commented Sep 3, 2025

please fix the build failure by running npm run format and update the formatted file.

@mcost45
Copy link
Contributor Author

mcost45 commented Sep 4, 2025

@fs-eire formatting was applied.

@fs-eire
Copy link
Contributor

fs-eire commented Sep 5, 2025

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows x64 QNN CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@mcost45
Copy link
Contributor Author

mcost45 commented Sep 16, 2025

Hi @fs-eire, I was just wondering if there's anything else I can do, or what would the next steps look like?

@fs-eire
Copy link
Contributor

fs-eire commented Sep 19, 2025

sorry for the late response - looks like the code need to update to latest main branch so that required pipelines can be triggered

@mcost45
Copy link
Contributor Author

mcost45 commented Sep 19, 2025

Thanks @fs-eire, I just rebased on latest

@fs-eire
Copy link
Contributor

fs-eire commented Oct 13, 2025

/azp run Windows GPU Doc Gen CI Pipeline, Windows ARM64 QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Linux QNN CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@fs-eire
Copy link
Contributor

fs-eire commented Oct 20, 2025

/azp run Windows GPU Doc Gen CI Pipeline, Windows ARM64 QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Linux QNN CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@fs-eire fs-eire merged commit f5654ed into microsoft:main Oct 21, 2025
90 checks passed
@mcost45 mcost45 deleted the mc branch October 22, 2025 06:32
JonathanC-ARM pushed a commit to JonathanC-ARM/onnxruntime that referenced this pull request Oct 24, 2025
…rosoft#25919)

### Description
This is a small change that includes the insertion of the `/*
@vite-ignore */` magic comment within the `build.ts` `postProcess`
function, alongside `/* webpackIgnore:true */`, for dynamic imports.

`/* @vite-ignore */` suppresses a Vite warning:

> The above dynamic import cannot be analyzed by Vite. See
https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
for supported dynamic import formats. If this is intended to be left
as-is, you can use the /* @vite-ignore */ comment inside the import()
call to suppress this warning.

, and does not change other behaviour. Note that it must be included as
a separate, distinct comment to match the
[regexp](https://github.com/vitejs/vite/blob/bcc31449c0c4f852ccb1eedda1842bc7ded23d01/packages/vite/src/node/plugins/importAnalysis.ts#L88).


### Motivation and Context
Resolves microsoft#25918. The Vite magic comment should be included because the
dynamic imports are intended 'to be left as-is', and the warning cannot
otherwise be disabled by an end-user (myself in an Angular project).
fs-eire pushed a commit that referenced this pull request Oct 24, 2025
)

### Description
This is a small change that includes the insertion of the `/*
@vite-ignore */` magic comment within the `build.ts` `postProcess`
function, alongside `/* webpackIgnore:true */`, for dynamic imports.

`/* @vite-ignore */` suppresses a Vite warning:

> The above dynamic import cannot be analyzed by Vite. See
https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
for supported dynamic import formats. If this is intended to be left
as-is, you can use the /* @vite-ignore */ comment inside the import()
call to suppress this warning.

, and does not change other behaviour. Note that it must be included as
a separate, distinct comment to match the
[regexp](https://github.com/vitejs/vite/blob/bcc31449c0c4f852ccb1eedda1842bc7ded23d01/packages/vite/src/node/plugins/importAnalysis.ts#L88).


### Motivation and Context
Resolves #25918. The Vite magic comment should be included because the
dynamic imports are intended 'to be left as-is', and the warning cannot
otherwise be disabled by an end-user (myself in an Angular project).
quic-tirupath pushed a commit to CodeLinaro/onnxruntime that referenced this pull request Oct 27, 2025
…rosoft#25919)

### Description
This is a small change that includes the insertion of the `/*
@vite-ignore */` magic comment within the `build.ts` `postProcess`
function, alongside `/* webpackIgnore:true */`, for dynamic imports.

`/* @vite-ignore */` suppresses a Vite warning:

> The above dynamic import cannot be analyzed by Vite. See
https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
for supported dynamic import formats. If this is intended to be left
as-is, you can use the /* @vite-ignore */ comment inside the import()
call to suppress this warning.

, and does not change other behaviour. Note that it must be included as
a separate, distinct comment to match the
[regexp](https://github.com/vitejs/vite/blob/bcc31449c0c4f852ccb1eedda1842bc7ded23d01/packages/vite/src/node/plugins/importAnalysis.ts#L88).


### Motivation and Context
Resolves microsoft#25918. The Vite magic comment should be included because the
dynamic imports are intended 'to be left as-is', and the warning cannot
otherwise be disabled by an end-user (myself in an Angular project).
naomiOvad pushed a commit to naomiOvad/onnxruntime that referenced this pull request Nov 2, 2025
…rosoft#25919)

### Description
This is a small change that includes the insertion of the `/*
@vite-ignore */` magic comment within the `build.ts` `postProcess`
function, alongside `/* webpackIgnore:true */`, for dynamic imports.

`/* @vite-ignore */` suppresses a Vite warning:

> The above dynamic import cannot be analyzed by Vite. See
https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations
for supported dynamic import formats. If this is intended to be left
as-is, you can use the /* @vite-ignore */ comment inside the import()
call to suppress this warning.

, and does not change other behaviour. Note that it must be included as
a separate, distinct comment to match the
[regexp](https://github.com/vitejs/vite/blob/bcc31449c0c4f852ccb1eedda1842bc7ded23d01/packages/vite/src/node/plugins/importAnalysis.ts#L88).


### Motivation and Context
Resolves microsoft#25918. The Vite magic comment should be included because the
dynamic imports are intended 'to be left as-is', and the warning cannot
otherwise be disabled by an end-user (myself in an Angular project).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Web] Magic import comment missing for Vite (/* @vite-ignore */)

2 participants