Comments (5)
@pneedham-mdsol Sure
const path = require('path')
module.exports = {
//...
resolve: {
react: path.resolve(__dirname, '..', '..', 'node_modules/react')
// Your path to React might be different
}
};
from react-component-library.
I'm realizing this because the component from the library is importing React, and it must grabbing it from its own node_modules. Is this something to be resolved from the consumer side?
from react-component-library.
The peerDepsExternal should see react
and react-dom
are peerDeps, then prevent them from being bundled (by adding them to Rollup's external). I'm not too sure how Webpack Analyzer works... but maybe see if the component library build files aren't including react
from react-component-library.
Thanks @HarveyD! I think on my app side during build, the import statement in the library component works it way up the tree to find the React package, and finds it in the node_modules
of the library's directory. I was able to get around that by adding a resolver to my Webpack config.
from react-component-library.
@jeremypurser could you kindly share that Webpack config resolver? I believe I'm running into a similar issue (duplicate versions of React).
from react-component-library.
Related Issues (20)
- [BUG] rollup can't build the library with redux-form HOT 1
- Is it possible to build project with static files? HOT 1
- [on styled-components branch]: mismatching versions of React HOT 3
- Quick comment HOT 1
- Invalid hook call HOT 1
- [Bug] styled-component still generate scss file HOT 1
- Unable to use css/scss module in webpack or rollup. HOT 3
- Material UI as peerDependency not working HOT 2
- Error: Could not resolve './TestComponent/TestComponent' from src\index.ts HOT 1
- Include tsconfig-paths-webpack-plugin for relative paths
- Config for jsx HOT 1
- Getting errors after npm install HOT 2
- [QUESTION] Three shaking in Next.js
- Code Splitting not Working HOT 1
- colors dev-dependency missing HOT 1
- [Feature] Add custom fonts
- taillwind intergration HOT 1
- how come your repo is working if you are not specifying that rollup.config.js is a ES module?
- Error: error:0308010C:digital envelope routines::unsupported HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-component-library.