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

Bundle command #610

Closed
matthewp opened this issue Feb 14, 2017 · 6 comments
Closed

Bundle command #610

matthewp opened this issue Feb 14, 2017 · 6 comments

Comments

@matthewp
Copy link
Member

matthewp commented Feb 14, 2017

Use case

Often times you might want to create a bundle that is not associated with a production build. This is just a bundle of modules that can be used by steal.

A common use-case would be bundling dependencies that do not change often (such as dependencies that are npm installed).

API

Two forms:

cli

steal-tools bundle some/filter/**/*

Node

stealTools.bundle({}, {
  filter: "some/filter/**/*"
});
@matthewp
Copy link
Member Author

Vague implementation steps

  1. - Create a standalone stealTools.bundle that creates a single bundle from a given filter.
  2. - Make it so that the configuration for those packages are included in the bundle.
  3. - Try to get it to load by mapping the @dev module: { map: { '@dev': 'my-bundle' } }`

@matthewp
Copy link
Member Author

Note that this will be a minor release. I'd rather do a prerelease and let this bake for a little while to get an idea of the API is right or not.

@matthewp
Copy link
Member Author

matthewp commented Feb 14, 2017

Will probably add a convenience shorthand for the use case of bundling node_modules:

steal-tools bundle --dev

Which should expand to:

stealTools.bundle({}, {
  filter: "node_modules/**/*",
  dest: "dev-bundle.js"
});

@matthewp
Copy link
Member Author

"steal": {
  "map": {
    "@dev": "dev-bundle"
  }
}

m-mujica pushed a commit that referenced this issue Feb 17, 2017
m-mujica pushed a commit that referenced this issue Feb 20, 2017
@matthewp
Copy link
Member Author

@m-mujica I would like to extend this out so that we can avoid having to load the package.json!npm at all in development.

The difference between this and what you've done so far is that in this "mode" it would not add the npmPackages, but instead it would leave in the config (and its deps) in the bundle.

I think this should be under some different flag. I'm not sure what those flags should be off the top of my head. Maybe something like:

Bundles only node_modules:

steal-tools bundle --deps

Bundles node_modules + package.json!npm (and its deps):

steal-tools bundle --dev

🤷‍♂️ Feel free to explore better names.

m-mujica pushed a commit that referenced this issue Mar 1, 2017
@matthewp
Copy link
Member Author

matthewp commented Mar 8, 2017

Fixed by #612

@matthewp matthewp closed this as completed Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants