Skip to content

Dependencies example - how to use 3rd party libraries #26

@dandv

Description

@dandv

The current example only has devDependencies. How would one intelligently use 3rd party libraries, which unlike when installing with bower, tend to arrive in non-standard directories?

So far, I've had to include paths manually to each .js file; there wasn't really a way to glob for dependencies, unless I'm missing something.

{
  "name": "idr-website",
  "version": "1.0.0",
  "description": "iDoRecall website",
  "main": "index.html",
  "scripts": {
    "prebuild:css": "wget http://cdn.jsdelivr.net/normalize/latest/normalize.css -q -O tmp/normalize.css",
    "build:css": "lessc --autoprefix src/index.less > tmp/index.css && cleancss tmp/normalize.css tmp/index.css -o dist/index.css",
    "build:js": "uglifyjs node_modules/asteroid/node_modules/ddp.js/src/ddp.js node_modules/asteroid/node_modules/q/q.js node_modules/asteroid/dist/asteroid.browser.js src/index.js --source-map --screw-ie8 -c -m -o dist/bundle.js",
...
}

Is there a smarter way to include those libraries from node_modules, asteroid, ddp and q?

This seems to make it impossible to generate proper source maps with UglifyJS2 because there's no constant number of directories to tell uglifyjs to drop via the -p parameter.

Similar question for the awkward normalize.css fetching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions