Closed late-warrior closed 8 years ago
We don't have repo for NPM, but the best solution would be to add separate files to this repo for NPM. However keeping both files (browser+npm) would be a pain. Another solution may be to create shim repo like Highcharts did (only for NPM), and with each release update files in that repo too. Again, maintaining this would be troublesome.
Any suggestions?
Probably automated process to build files (ant?) from parts would resolve that case:
module.exports
part) And before each commit, build this project.
For the 'build from parts' approach - here is a crude one without using ant - https://github.com/golyakov/highstock-browserify . The 'build script' is run using npm (using the 'scripts' tag in package.json) - https://github.com/golyakov/highstock-browserify/blob/master/build.sh .
I think the best approach might be to use tools like browserify/webpack.
We can author in commonjs format (to keep npm happy) and then use webpack to build a 'browser' version which shims the npm 'require'. Then have a post commit hook (like you suggested) which will 'build' the browser version.
Hi, is there a npm counterpart to this plugin so that I can use it on the server side ?
One possible way to do this (without having to change existing code too much):
I haven't given thought to how to keep the 'browser' version and 'npm' version in sync though.