question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `fly.imports` key to `package.json` config

See original GitHub issue

Pulled from #233

For the sake of reusable, private plugins:

{
  "fly": {
    "imports": [
      "./build/custom-task-one.js",
      "./build/custom-task-two.js",
      "./build/custom-task-three.js"
    ]
  }
}
// build/custom-task-one.js
module.exports = function () {
  this.plugin('plugOne', {every: 0}, function * (files, opts) {
    // custom stuff
  })
}

// flyfile.js
yield this.source('src').plugOne({hello: 'world'}).target('dist');

Open to alternative names for the imports key.

The same functionality can be achieved using npm link (or npm install and file:./ as a dependency), but this requires that each plugin has its own package.json file.

You can group multiple plugins in the same “package” (example). However, this method also doesn’t scale well & becomes quite messy to manage.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
lukeedcommented, Nov 14, 2016

@devmondo You can now access this by installing the latest beta release.

1reaction
devmondocommented, Nov 7, 2016

man lovely!!! i cant wait for this to be released

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add custom metadata or config to package.json, is it valid?
Yes, you're allowed to add custom entries to package.json . Choose a key name: not already defined (details below); not reserved for future...
Read more >
Modules: Packages | Node.js v19.3.0 Documentation
Exports sugar; Subpath imports; Subpath patterns; Conditional exports ... The package consists of the folder containing the package.json file and all ...
Read more >
package.json - npm Docs
This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a...
Read more >
Package exports - webpack
The exports field in the package.json of a package allows to declare which module should be used when using module requests like import...
Read more >
Config Files - Babel.js
.babelrc.json files only apply to files within their own package ... import() always returns a promise!): for this reason, .mjs config files will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found