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

Support AMD / RequireJS #40

Closed
niutech opened this issue Apr 12, 2019 · 5 comments
Closed

Support AMD / RequireJS #40

niutech opened this issue Apr 12, 2019 · 5 comments

Comments

@niutech
Copy link

niutech commented Apr 12, 2019

I can read that you support CommonJS modules, but what about AMD / RequireJS? Could you transform them as well? Example: knockout-jqautocomplete.

@FredKSchott
Copy link
Owner

Any interest in helping us try something out? :)

The tool was built for ESM top-level dependencies, with a goal of supporting any CommonJS/AMD/RequireJS transitive/sub- dependencies. So if this is a sub-dependency of your project, it should just work.

If you want to rely on this non-ESM file directly, you just have to add the exact file path to your whitelist. Something like:

"whitelist": [ "knockout-jqautocomplete/build/knockout-jqAutocomplete.js"]

Can you try that out and let me know how it works? AMD/UMD were never meant to be supported, but because they have no import statements to worry about I think that we get their support for free.

@jarrodek
Copy link

I tried adding this:

"whitelist": [
      "marked/index.js",
      "@polymer/marked-element/marked-import.js"
]

but it makes no difference.

@FredKSchott
Copy link
Owner

can you share your entire package.json? I want to be sure that you're properly defining it (you can check the README) to be sure. If you have properly configured it, at the very least @pika/web should fail, and not ignore it.

@jarrodek
Copy link

Sure, it's here: https://github.com/advanced-rest-client/arc-electron/blob/develop/package.json#L269

Also, my comment was supposed to be added to this issue: PolymerElements/marked-element#100
I had too many tabs opened...

@pika-ci
Copy link

pika-ci bot commented Sep 10, 2019

🚚 This issue has been moved! Continue the discussion on our project discussion board:
https://pika.dev/packages/@pika/web/discuss/1084

@pika-ci pika-ci bot closed this as completed Sep 10, 2019
@pika-ci pika-ci bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants