-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ESModules for proxy.config file #21623
Labels
area: devkit/build-angular
devkit/build-angular:dev-server
feature
Issue that requests a new feature
Milestone
Comments
clydin
added a commit
to clydin/angular-cli
that referenced
this issue
Sep 22, 2021
…files for the dev server The `proxyConfig` option now supports loading ESM configuration files in addition to JSON and CommonJS files. ESM files (such as those ending with `.mjs`) must provide a default export with the configuration object. For example, a `proxy.config.mjs` containing the follow is now possible: ``` export default { "/api/*": { "target": "http://127.0.0.1:5001" } }; ``` Closes angular#21623
clydin
added a commit
to clydin/angular-cli
that referenced
this issue
Sep 23, 2021
…files for the dev server The `proxyConfig` option now supports loading ESM configuration files in addition to JSON and CommonJS files. ESM files (such as those ending with `.mjs`) must provide a default export with the configuration object. For example, a `proxy.config.mjs` containing the follow is now possible: ``` export default { "/api/*": { "target": "http://127.0.0.1:5001" } }; ``` Closes angular#21623
clydin
added a commit
to clydin/angular-cli
that referenced
this issue
Sep 23, 2021
…files for the dev server The `proxyConfig` option now supports loading ESM configuration files in addition to JSON and CommonJS files. ESM files (such as those ending with `.mjs`) must provide a default export with the configuration object. For example, a `proxy.config.mjs` containing the follow is now possible: ``` export default { "/api/*": { "target": "http://127.0.0.1:5001" } }; ``` Closes angular#21623
clydin
added a commit
to clydin/angular-cli
that referenced
this issue
Sep 23, 2021
…files for the dev server The `proxyConfig` option now supports loading ESM configuration files in addition to JSON and CommonJS files. ESM files (such as those ending with `.mjs`) must provide a default export with the configuration object. For example, a `proxy.config.mjs` containing the follow is now possible: ``` export default { "/api/*": { "target": "http://127.0.0.1:5001" } }; ``` Closes angular#21623
clydin
added a commit
that referenced
this issue
Sep 24, 2021
…files for the dev server The `proxyConfig` option now supports loading ESM configuration files in addition to JSON and CommonJS files. ESM files (such as those ending with `.mjs`) must provide a default export with the configuration object. For example, a `proxy.config.mjs` containing the follow is now possible: ``` export default { "/api/*": { "target": "http://127.0.0.1:5001" } }; ``` Closes #21623
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: devkit/build-angular
devkit/build-angular:dev-server
feature
Issue that requests a new feature
🚀 Feature request
Command (mark with an
x
)Description
Angular CLI now supports proxy configuration for both .json and .js extensions, however, trying to have a proxy with .mjs file, in order to have the javascript file importing other modules, produces an error message.
A clear and concise description of the problem or missing capability...Describe the solution you'd like
I've discovered that using dynamic import instead of
If you have a solution in mind, please describe it.require
on addProxyConfig function on dev-server.ts file, does this work.Describe alternatives you've considered
I have searched for some flags that will allow me to do so and haven't found any, and the only solution I can find is to go to require.
The text was updated successfully, but these errors were encountered: