-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Feature Request] Add documentation on how to use without the CLI interface #25
Comments
Hey @hydrosquall, so at the moment the behavior of this package is to either check dependencies defined in A nice (and a little bit cleaned up) example of usage can be taken from import { getBabelLoaderIgnoreRegex } from './babel-loader-regex-builder'
import { ModulesChecker } from './modules-checker'
import IModuleCheckerConfig from './types/module-checker-config'
const config: IModuleCheckerConfig = {
checkAllNodeModules: true,
ignoreBabelAndWebpackPackages: true,
logEs5Packages: true
}
// This should be a path to a directory containing both a
// package.json file and node_modules directory
const path = "path/to/dir"
const checker = new ModulesChecker(path, config)
const nonEs5Dependencies = checker.checkModules()
console.log(getBabelLoaderIgnoreRegex(nonEs5Dependencies)) I'm not sure if this helps, let me know if it doesn't and I'll try to do my best to help out! |
Hi @obahareth , this cleaned up code sample is very helpful for my original question, and will definitely be useful for ensuring cross-browser compatibility in a different project :). I ended up closing my first attempt at a fix for this particular team, (nextstrain/auspice#928 (comment)) since the dependencies that were picked up were only relevant for the dev server, so they didn't need to be transpiled. Is there a way to have the package check all the libraries that are imported given a particular entrypoint (e.g some |
Hi @hydrosquall, unfortunately that's not possible at the moment, but a pull request would be very welcome! |
This has been fixed in #32. |
Hi,
There's a project used by researchers which lets users provide a path to custom extensions, which sometimes contain non ES5 modules. However, these paths aren't known until runtime.
nextstrain/auspice#902
These paths are added here:
https://github.com/nextstrain/auspice/blob/2bd55502cb3b5dc94088a4ace3c377ba67f2d31f/webpack.config.js#L25-L33
I'd be interested in using this library to check those paths, and having the result added to the
exclude
used by babel-loader. It might be possible to do this already, but I wasn't sure how to do that just from skimming the README.Thanks for any thoughts or advice!
The text was updated successfully, but these errors were encountered: