-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Bundle for CDN #5796
Bundle for CDN #5796
Conversation
b4b4a6b
to
400d1a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea to build a UMD package.
Using Rollup as pouchdb
would most likely provide a more performance bundle, but let's keep thing simple with webpack for now 👍 .
@@ -1,3 +1,18 @@ | |||
#### UMD Packaging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move that section lower in the README.
}, | ||
], | ||
|
||
// plugins: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why keeping that commented block?
{ | ||
test: /(\.jsx|\.js)$/, | ||
loader: 'babel', | ||
exclude: /(node_modules|bower_components)/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need to exclude the bower_components
. We don't use bower.
@oliviertassinari Thanks for the feedback. I'll update with fixes for those items. |
400d1a2
to
b6427ad
Compare
Hold on... the rebase shouldn't have done that. Will try again |
npm run build:umd && npm run build:min && cp dist/* ./targetDir
b6427ad
to
88f62ac
Compare
@oliviertassinari I think that's now ready for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for continuing the old PR!
Any idea what's breaking the build? I haven't figured out.
@@ -23,3 +24,4 @@ jsconfig.json | |||
|
|||
# tmp | |||
tmp* | |||
*~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is it for? Shouldn't it be in your user gitignore?
For using with React and React DOM from a CDN or as separate minified scripts, you can build | ||
files with UMD module support as follows: | ||
|
||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather be more explicit with:
```sh
npm install
```
|
||
To see what's going on under the hood, you can use webpack directly: | ||
|
||
webpack --display-reasons --display-modules --progress --optimize-minimize --colors --entry ./src/index.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before for explicitness
}, | ||
}, | ||
], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove those blank lines?
module: { | ||
loaders: [ | ||
{ | ||
test: /(\.jsx|\.js)$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need jsx
: /\.js$/,
Actually, that was an npm cache issue, the build is green now :). |
I'm merging it, I'm gonna address the comment. Thanks! |
Nice, now let's put ther latest version In CDNJs with auto update for each release 😀 |
Hi all, sounds like you guys have successfully created the CDN UMD version of the files. Can you please share a URL? Thanks in advance. |
@ravilution It's on the homepage: |
@oliviertassinari thanks man. I missed that place. I was looking here. My bad. If I have to use material icons from CDN, there is no UMD file for that, right? I will have to use below font based implementation. Correct me if am wrong. <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> |
@ravilution font icon is the way to go with CDN 👍 . |
This is a re-work of ideas from #4342, but based on 'next' branch so that things can work without the react-tap-event-plugin.
I'll attempt to use this for our development build, but confine this PR to what's needed for the CDN bundle