-
Notifications
You must be signed in to change notification settings - Fork 146
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
Load via npm as module #24
Comments
Agreed. After a bit of investigation, it looks like this would be achievable fairly easily by turning the T3 source files into CommonJS format and using browserify to build the files in |
I'll handle the CommonJS/browserify changes |
- adding proxyquire for testing browserified source files - modified tests to use CommonJS - modified build process to account for browserification - downgraded karma-coverage to 0.2.6 to support browserify-istanbul - updated ESLint rules to account for CommonJS changes fixes #24
- adding proxyquire for testing browserified source files - modified tests to use CommonJS - modified build process to account for browserification - downgraded karma-coverage to 0.2.6 to support browserify-istanbul - updated ESLint rules to account for CommonJS changes fixes #24
- adding proxyquire for testing browserified source files - modified tests to use CommonJS - modified build process to account for browserification - downgraded karma-coverage to 0.2.6 to support browserify-istanbul - updated ESLint rules to account for CommonJS changes fixes #24
If going the Browserify route, it would probably be good to go a little further and write these as ES6 Modules. A lot of projects are moving in that direction and with ES6 being passed this June, it isn't too early in the process. Then you could use the ES6 Modules directly if your project already uses ES6 and a transpiler or you could use Browserify to create standard ES5 code or CommonJS modules. ES6 Modules don't require any other ES6 features to be used so the code itself doesn't have to change any more than you already changed for CommonJS. |
- adding proxyquire for testing browserified source files - modified tests to use CommonJS - modified build process to account for browserification - downgraded karma-coverage to 0.2.6 to support browserify-istanbul - updated ESLint rules to account for CommonJS changes fixes #24
- wrapping t3 with a module.exports shim fixes #24
- wrapping t3 with a module.exports shim fixes #24
- wrapping t3 with a module.exports shim fixes #24
- wrapping t3 with a module.exports shim fixes #24
Now, there is no way to load
t3js
properly via browserify or webpack, as package.json does not have any main file entry, so I can't just write:But it would be very nice to have such opportunity (not to use global Box variable, but the one exported by module).
The text was updated successfully, but these errors were encountered: