Replies: 34 comments 2 replies
-
You can try |
Beta Was this translation helpful? Give feedback.
-
xxxxx package insert "dependencies": {
"xxxxx": "0.0.1"
} yarn dev 🔴 ERROR | Inline JavaScript is not enabled. Is it set in your options? |
Beta Was this translation helpful? Give feedback.
-
parcel-bundler/parcel#907 (comment) |
Beta Was this translation helpful? Give feedback.
-
@crazyair just tried this example, it seems to work for me: https://github.com/PlasmoHQ/examples/tree/main/with-ant-design The tilde import means from the root of the current project for Plasmo (and latest Parcel), NOT from |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
can you give me the project you're trying to use? Or is it antd itself? |
Beta Was this translation helpful? Give feedback.
-
Also, if they use |
Beta Was this translation helpful? Give feedback.
-
You can install popup.tsx import { ProCard } from '@ant-design/pro-components';
<ProCard title="默认尺寸" extra="extra" tooltip="这是提示" style={{ maxWidth: 300 }}>
<div>Card content</div>
<div>Card content</div>
<div>Card content</div>
</ProCard> 🔴 ERROR | The @import path "\~antd/es/style/themes/index.less" is using webpack specific syntax, which isn't supported by Parcel.
To @import files from node\_modules, use "antd/es/style/themes/index.less"
··· |
Beta Was this translation helpful? Give feedback.
-
demo: PlasmoHQ/examples#15 |
Beta Was this translation helpful? Give feedback.
-
This is a "missing feature" within Parcel's less transformer: https://github.com/parcel-bundler/parcel/blob/v2/packages/transformers/less/src/LessTransformer.js#L115 OR more likely, inconsistency with parcel's definition of the Some potential solutions:
@crazyair can you link me the doc for the tilde path import in less? Also, would you be down to investigate and implement a solution? |
Beta Was this translation helpful? Give feedback.
-
NOTE: These examples you're referencing uses |
Beta Was this translation helpful? Give feedback.
-
external project Deleting
🔴 ERROR | Inline JavaScript is not enabled. Is it set in your options? |
Beta Was this translation helpful? Give feedback.
-
Do you have the lessrc option in your project? |
Beta Was this translation helpful? Give feedback.
-
The main project has, but the external project does not |
Beta Was this translation helpful? Give feedback.
-
Can you do a bundling of the external project into some plain component, and just import the output inside plasmo and use it that way then? |
Beta Was this translation helpful? Give feedback.
-
Why would that matters for a dependency? Their ES version requires custom resolver for those less path |
Beta Was this translation helpful? Give feedback.
-
Only one path is referenced, lib or es. |
Beta Was this translation helpful? Give feedback.
-
you can import directly like |
Beta Was this translation helpful? Give feedback.
-
I've tried everything but still haven't solved it 😭 |
Beta Was this translation helpful? Give feedback.
-
no dist,need change less variable |
Beta Was this translation helpful? Give feedback.
-
^ There's a dist directory if you installed the specific |
Beta Was this translation helpful? Give feedback.
-
have you tried hacking the less transformer? Basically, make it align with the way webpack bundle less source as antd. Also I have no idea how other project uses antd-pro unless they have a similar webpack bundler OR postcss plugin to reconfigure those paths. |
Beta Was this translation helpful? Give feedback.
-
No problem with webpack or umi |
Beta Was this translation helpful? Give feedback.
-
@crazyair in Umi for it to work with latest antd-pro, you also need to hack up the less path on webpack config: https://v3.umijs.org/guide/upgrade-antd-pro-to-umi-3#%E9%85%8D%E7%BD%AE%E5%B1%82%E8%BF%81%E7%A7%BB So yeah for it to work with parcel, you will need to play around with the less transformer as well and maybe handle the antd special case, OR if antd managed to make their convention widespread enough, implement it as default |
Beta Was this translation helpful? Give feedback.
-
How is parcel configured and can it be built-in? |
Beta Was this translation helpful? Give feedback.
-
Yes, see this comment: #143 (comment) |
Beta Was this translation helpful? Give feedback.
-
Second, I've tried, but I can't |
Beta Was this translation helpful? Give feedback.
-
@crazyair I encountered the same problem, the solution is parcel-bundler/parcel#6623 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@crazyair You can use a script similar to the one executed after postinstall.
|
Beta Was this translation helpful? Give feedback.
-
What happened?
index.less content
@import '~antd/dist/antd.less';
Version
Latest
What OS are you seeing the problem on?
MacOSX
What browsers are you seeing the problem on?
Microsoft Edge
Relevant log output
But this project is OK
https://github.com/ant-design/parcel-antd/blob/master/src/style/index.less#L1
(OPTIONAL) Contact Details
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions