Git Product home page Git Product logo

Comments (7)

mzabriskie avatar mzabriskie commented on June 13, 2024

I totally agree. I have plans to include a dist/ folder with built source. I will also be releasing to bower. Give me until the end of the week and I should have something for you.

from react-draggable.

cjblomqvist avatar cjblomqvist commented on June 13, 2024

Thanks for quick response! Also, I noticed that the bundle is about 1.8mb, which seems quite strange to me. Just something that might be nice to be aware of. For example, it seems test and example code is included in the bundle.

from react-draggable.

cjblomqvist avatar cjblomqvist commented on June 13, 2024

Some pointers that I think might help newcomers (that I find after digging around a bit):

  • The webpack currently compiles the example. I'd expect a compiled file which I can just add through a script-tag. This was really confusing and I totally missed that in webpack.config.js when I tried to figure out what was wrong.
  • The build instructions doesn't work in Windows (it assumes shell script exists). Should be fairly straight forward to convert it to be run by node instead and make it cross platform compatible I'd guess?
  • The size of the webpack is quite big. I tried to see if it'd help a lot to remove non-production code - it doesn't seem to help that much. However, the --devtool inline-source-map default option causes 1 extra mb of (non-compiled). Might not be optimal from a production perspective. One can also add something along the following lines to make the non-production stuff go away (at least when minifying).
var DefinePlugin = require('webpack').DefinePlugin;

// other code ...

plugins: [
    new DefinePlugin({
      'process.env': {
        'NODE_ENV': JSON.stringify(process.env.NODE_ENV ? process.env.NODE_ENV : '')
      }
    })
  ]

A suggestion might be to auto-compile one production ready version and one developer ready version.

Anyway, just some hopefully helpful thoughts that hopefully can save some time from you.

from react-draggable.

cjblomqvist avatar cjblomqvist commented on June 13, 2024

Hmm, I guess it doesn't work to use webpack that way, at least not without some hacking: https://github.com/webpack/docs/wiki/webpack-for-browserify-users#external-requires

from react-draggable.

cjblomqvist avatar cjblomqvist commented on June 13, 2024

Hmm, after a closer look, it should be easily configured by using for example something like this:

output: {
filename: './build/bundle.js',
library: "ReactDraggable",
libraryTarget: "var"
},

from react-draggable.

mzabriskie avatar mzabriskie commented on June 13, 2024

@cjblomqvist I just released version 0.2.0 which includes dist/ when using npm. I have also registered the package with bower. So either way you are installing your use case should be supported.

from react-draggable.

cjblomqvist avatar cjblomqvist commented on June 13, 2024

Very nice work - solves all my previous "issues". Much appreciated!

from react-draggable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.