react-npm-component-starter | minimal boilerplate for building a react component | Frontend Framework library
kandi X-RAY | react-npm-component-starter Summary
kandi X-RAY | react-npm-component-starter Summary
I no longer maintain this boilerplate and I recommend you use this one instead. It uses Rollup to bundle the library which is better for a variety of reasons as compared to using only babel as was done here. Good luck!.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-npm-component-starter
react-npm-component-starter Key Features
react-npm-component-starter Examples and Code Snippets
Community Discussions
Trending Discussions on react-npm-component-starter
QUESTION
I'm developing a react UI component and it depends on another UI component (react-widgets/lib/DropDownlist). This javascript module has resources that end with these file extensions: *.gif, *.eot, *.svg, *.woff, *.ttf.
Webpack4 is complaining that it doesn't know how to process these file types and that I might need a loader to handle these file type. One error is:
...ANSWER
Answered 2018-May-26 at 07:49It all depends on your workflow, how u want to load assets at run-time.
For eg, if u have lot of images, it might be a good idea to use a file-loader and place them directly inside the build directory.
The above approach will increase the GET calls and the bundled js file size will not be affeted
If u have less images/small size images then you can use url-loader which converts them into data-URL and put them inside your bundled js files.
The above approach will reduce the GET calls and will slightly increase the bundled js size.
If u want combination of both, then u can set a size limit and fallback loader(file-loader) on url-loader. What this will do is, the size of the dataURL will be calculated.If the size is grater than the limit, the file-loader will be used, which will place it in the build directory.
How I use them
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-npm-component-starter
git clone https://github.com/yogaboll/react-npm-component-starter.git
npm install
npm run dev to transpile both the lib and docs folder in watch mode and serve the docs page for you.
Go to http://127.0.0.1:8000 to see the demo in action. Whenever you change the code in either src/lib or src/docs, the page will automatically update.
rm -rf .git
git init
git add .
git commit -m "setup project"
Change the "name" field in the package.json file (the npm package will get this name), as well "description", "author" and any other fields that need to change.
npm publish
Go to npmjs.com/package/[YOUR COMPONENT NAME]/ to confirm that it has been published.
npm run docs:prod - Make a production bundle of the demo app.
Commit your changes to git and push to your GitHub repository.
On your GitHub repo page, click the settings tab and scroll down to the GitHub Pages heading. Pick master branch /docs folder in the source dropdown, And BOOM, your demo page is already live on the internet for free.
Note: Sometimes it might take about an hour for the page to actually start hosting. Adding /index.html after the url works instantly for whatever reason.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page