Skip to content
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

Standalone mode #28

Closed
viceice opened this issue Dec 12, 2019 · 9 comments
Closed

Standalone mode #28

viceice opened this issue Dec 12, 2019 · 9 comments

Comments

@viceice
Copy link
Contributor

viceice commented Dec 12, 2019

I like to use this plugin in standalone prettier to support formating in monaco editor.

If i try to use this plugin i get webpack compiler errors.

@viceice
Copy link
Contributor Author

viceice commented Dec 12, 2019

My webpack workaround:

{
  resolve: { alias: { prettier$: require.resolve('prettier/standalone') } }
}

@rart
Copy link

rart commented Dec 14, 2019

I've noticed the same situation. Using it within a react app, compiler outputs:

Compiled with warnings.

./node_modules/prettier/index.js
Critical dependency: the request of a dependency is an expression

./node_modules/prettier/index.js
Critical dependency: the request of a dependency is an expression

./node_modules/prettier/index.js
Critical dependency: the request of a dependency is an expression

./node_modules/prettier/third-party.js
Critical dependency: the request of a dependency is an expression

./node_modules/prettier/parser-typescript.js
Module not found: Can't resolve '@microsoft/typescript-etw' in '/yada/yada/node_modules/prettier'

Note that in create-react-app, is not possible to configure the webpack aliases unless you eject or use the rewired package so this is important to address via this package itself.

I've submitted a PR which solves this issue.

@kddnewton
Copy link
Member

@viceice I'm about to release v0.4.0, once I do could you try again? I want to fully understand this issue

@thorn0
Copy link
Member

thorn0 commented Jan 21, 2020

Would it help if Prettier added the browser property to its package.json pointing to standalone.js?

@kddnewton
Copy link
Member

kddnewton commented Jan 21, 2020 via email

@viceice
Copy link
Contributor Author

viceice commented Jan 21, 2020

@viceice I'm about to release v0.4.0, once I do could you try again? I want to fully understand this issue

Yes, but earliest on next week. But our ci will get the update as you publish it. So I can check the result.

@kddnewton
Copy link
Member

Does #55 solve this issue?

@rart
Copy link

rart commented Feb 10, 2020

@kddeisz, It does.

@kddnewton
Copy link
Member

Nice - I've release v0.7.1 with the change. Going to optimistically close this. Feel free to reopen if it's still an issue.

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

No branches or pull requests

4 participants