Skip to content

Conversation

@hieunhit
Copy link

@hieunhit hieunhit commented Jan 9, 2026

This pull request updates the build process and documentation to support both a React-based and a standalone version of the traitify-widgets package. It introduces new build outputs, updates the package exports, and clarifies usage in the README.

Build system and packaging improvements:

  • Added an exports field in package.json to expose both the main build (./build/traitify.js) and a new standalone build (./build/traitify-standalone.js) for modular consumption.
  • Updated build scripts in package.json to generate both the standard and standalone builds using separate commands and output names.
  • Modified webpack.config.js to accept an output environment variable, allowing dynamic naming of the output file (e.g., traitify.js or traitify-standalone.js). [1] [2]

Documentation updates:

  • Updated README.md to clarify usage for both the React-based and standalone versions, including import instructions for each.

@hieunhit hieunhit marked this pull request as draft January 9, 2026 06:45
@tomprats tomprats force-pushed the feat/standalone_version branch from ea527f1 to 9f80569 Compare January 15, 2026 21:37
Copy link
Member

@tomprats tomprats left a comment

Choose a reason for hiding this comment

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

I made some updates to keep it inline with my thoughts and then I pushed out a new alpha version to test. You should now be able to use the standalone export in 3.9.0-alpha.1

README.md Outdated
traitify.render("#the-id-of-the-target-you-wish-to-render-to");
```

##### Standalone version
Copy link
Member

Choose a reason for hiding this comment

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

I don't want to promote the use of it, for now it's a Paradox special

package.json Outdated
},
"exports": {
".": "./build/traifity.js",
"./all": "./build/traifity-standalone.js"
Copy link
Member

Choose a reason for hiding this comment

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

I updated it to be standalone since all could be misleading

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.

2 participants