Git Product home page Git Product logo

svb's Introduction

svelte-bundler

๐Ÿ“ฆ A zero-config CLI to bundle Svelte apps.


This is a (mildly) opinionated and very lightweight Svelte compiler/bundler, which is meant to take some of the headaches out of setting up and configuring simple Svelte projects.

Differs from Sapper, which is more of a fully baked solution which includes SSR, routing and other goodies. This is more akin to the react-scripts used in create-react-app, where all of the config is hidden away so that you can just focus on building cool Svelte apps.

Notice: This is very much a work in progress right now, so feel free to contribute! We'd love to get some feedback and ideas!

Installation

Note: Currently requires NodeJS >= 8.16.0

yarn add -D svb

npm i -D svb

You could also install this globally:

yarn global add svb

npm i -g svb

This provides you with the global svb binary (as well as a svelte-bundler alias, in case you like typing).

Documentation

Please view the documentation here!


Created by Dave in 2019 โœŒ๏ธ

svb's People

Contributors

dependabot[bot] avatar himynameisdave avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

damassi fossabot

svb's Issues

[Bug] Builds fail when output dir is not defined

Describe the bug
Builds fail when output dir is not defined

To Reproduce
Steps to reproduce the behavior:

  1. svb -i src/index.js -o some/unkown/dir

Expected behavior
Should generate all directories listed, using mkdirp.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: [e.g. macOS 10.14.5]
  • svb Version: [eg: 0.1.0]
  • NodeJS Version: [eg: v12.5.0]

Additional context or comments
Maybe we should delete the output dir before a build? Does mkdirp do that?

Handle generation of root index.html file

Is your feature request related to a problem? Please describe.
Problem: currently only CSS and JS bundles are produced. We should create (or use a userland template) for an index.html file that could actually be loaded.

Describe the solution you'd like
An index.html file is generated/converted from a template and pulls in the JS and CSS bundles.

Additional context
Not sure where the userland template should live, also if we should fall back to something else if it's not there.

Allow custom bundle names

Is your feature request related to a problem? Please describe.
Users may wish to customize the name of the outputted bundle.css and bundle.js files.

Describe the solution you'd like
Perhaps an option or flag for customizing the names?

Additional context
Side note: What about being able to optionally include a hash on the filename, to help with cache busting?

Handle assets

Is your feature request related to a problem? Please describe.
Users are going to need something to deal with images/video/media/etc.

Describe the solution you'd like
There should be something in the build step to handle assets I guess.

Describe alternatives you've considered
Like in some ways this almost goes against the concept of this being a "small" bundler, but in general like folks should be able to handle assets like this.

Additional context

Allow user to specify location of HTML template

Is your feature request related to a problem? Please describe.
Users could pass in an option to specify where the HTML file is located.

Describe the solution you'd like
--template or something like that

Describe alternatives you've considered
Similar to #2, but slightly more distinct.

Include example project

Describe what needs to be done

  • To help folks understand how to use this package (and also to help test things), let's include an example/ project.

Are there any dependency updates?

  • N'est pas

Add coveralls/coverage

Describe what needs to be done

  • Add coveralls for test coverage data.

Are there any dependency updates?

  • yep, coveralls

Better CSS processing

Is your feature request related to a problem? Please describe.
Set sensible defaults and explore the best practices for CSS generation.

Describe the solution you'd like

Additional context
Not sure what needs to be done here specificall.

Setup CI

Describe what needs to be done

  • Setup travis.ci once all the testing stuff gets set up

Dev/watch mode

Is your feature request related to a problem? Please describe.
Users will probably want to run this in "watch" mode to allow for rapid development.

Describe the solution you'd like
It should use rollup's watch mode, along with anything else which might make the dev experience even better (such as nicer error reporting if the compile step fails -- just like create-react-app).

Why?

What a difference between this package and sveltejs/template except the moment that this packages makes not possible to customize you bundle configuration?

[Bug] Index/template not generated on first --watch run

Describe the bug
[Bug] Index/template file is not generated on first --watch run, when run on a fresh directory.

To Reproduce
Steps to reproduce the behavior:

  1. svb -i src/index.js -o empty/directory/ -w

Expected behavior
Should build & bundle the template on every run. Just saying. Even in watch mode.

Versions (please complete the following information):

  • svb Version: 0.3.0.beta.0
  • NodeJS Version: v12.8.1

Additional context or comments
Add any other context about the problem here.

Add integration/e2e tests

Describe what needs to be done

  • Add tests to ensure it actually works from a user perspective (ie: running the command actually produces the files in the places which it should).

Are there any dependency updates?

  • None, unless any are needed to assist with this.

Write unit tests for code

Describe what needs to be done

  • Add some unit testing for modules/code which should be unit tested.

Are there any dependency updates?

  • Nope Add Jest

Add linting

Describe what needs to be done

Are there any dependency updates?

  • Yeap gonna be adding some deps.

Eject command

Is your feature request related to a problem? Please describe.
Users might want to eject and in theory we should support that. That way this project can remain opinionated while allowing for users to do their own thing if they choose.

Describe the solution you'd like

  • svb --eject or something.
  • An "are you sure" prompt.

Describe alternatives you've considered
Not sure if this should be done or not, but it's not critical for getting this project off the ground.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.