Browserify: Use module.exports if required, otherwise expose global

前端 未结 4 1997
盖世英雄少女心
盖世英雄少女心 2021-01-31 08:09

I\'m considering adopting browserify for some of my projects, but would like to make sure that others don\'t have to use browserify if they want to use the (bundled) code. The o

4条回答
  •  野的像风
    2021-01-31 08:41

    There is a good article from Forbes Lindesay explaining how to do standalone builds: http://www.forbeslindesay.co.uk/post/46324645400/standalone-browserify-builds

    The short version, use the standalone option:

    browserify beep.js --standalone beep-boop > bundle.js
    

提交回复
热议问题