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

Webpack ESM build #101

Merged
merged 1 commit into from
May 6, 2021
Merged

Webpack ESM build #101

merged 1 commit into from
May 6, 2021

Conversation

ellthompson
Copy link
Contributor

Webpack can now be called with the environment variable MODULE=true to build .mjs versions of the PCUI library files.

The npm build script now builds umd and esm versions of PCUI.

The readme has been updated to correctly use the .mjs files in it's examples.

Fixes #100

@ellthompson ellthompson added the enhancement New feature or request label Apr 30, 2021
@ellthompson ellthompson requested a review from a team April 30, 2021 10:44
@ellthompson ellthompson self-assigned this Apr 30, 2021
@mvaligursky
Copy link

is it common to use environment variable vs passing command line option for this kind of stuff?

@ellthompson
Copy link
Contributor Author

is it common to use environment variable vs passing command line option for this kind of stuff?

Yeah i'd say so. It's used in the official documentation. It looks like command line variables only cropped up in webpack version 5.

@ellthompson ellthompson merged commit 29fc38b into master May 6, 2021
@ellthompson ellthompson deleted the webpack-esm-build branch August 26, 2021 14:28
@BruceWheaton
Copy link

Just ran into a possibly related build error - do I need to edit my webpack config? I'm using a starter that mimics create-react-app and adds in node/express.
`ERROR in ./node_modules/@playcanvas/pcui/react/dist/pcui-react.mjs 786:16
Module parse failed: Unexpected token (786:16)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| }
|

attachElement = (nodeElement, containerElement) => {
| if (!nodeElement) return;
| this.element = new this.elementClass({ ...this.props,
@ ./src/components/Example.jsx 2:0-59 14:89-98 14:140-146
@ ./src/App.jsx`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The requested module does not provide an export named 'Label'
4 participants