Skip to content
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

The proper way to include js libraries? #954

Open
artshostak opened this issue Sep 26, 2017 · 1 comment
Open

The proper way to include js libraries? #954

artshostak opened this issue Sep 26, 2017 · 1 comment

Comments

@artshostak
Copy link

artshostak commented Sep 26, 2017

What is the right way to bring in 3rd-party libraries in the build for development and production? Obviously installing the packaged via npm/yarn into the 'node_modules' folder appears to be the first step, but what's the right way to include them? Referencing them in the 'gulpfile.babel.js' file (for main.min.js output) as well as the 'index.html' file (for main.js) seems like the right approach, but usually causes gulp to stutter and return ESLint errors. Can't find any documentation regarding this, would love to know what the accepted method is.

@shariqraza
Copy link

Your referencing sounds right

Referencing them in the 'gulpfile.babel.js' file (for main.min.js output) as well as the 'index.html' file (for main.js)

for the ESLint errors, you can choose to ignore the 3rd-party files from linting, here's how:

  1. Create a .eslintignore file at your project root.
  2. add ignore rule for a file e.g: app/scripts/vendor.min.js or entire folders e.g: app/scripts/vendors/*

https://eslint.org/docs/user-guide/configuring#specifying-file-extensions-to-lint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants