GithubHelp home page GithubHelp logo

Comments (9)

cgmartin avatar cgmartin commented on August 20, 2024

Sounds like the primary use case is keeping the NG2 quickstart instructions simple.

Using a custom browser sync config file that replaces lite-server would require changing the quickstart documentation, adding a file to copy/paste in addition to the package.json that is already required. ie.

var historyFallback = require('connect-history-api-fallback');
var log = require('connect-logger');
/*
 | For up-to-date information about the options:
 |   http://www.browsersync.io/docs/options/
 */
module.exports = {
    "files": [
      './**/*.html', './**/*.css', './**/*.js'
    ],
    "server": {
      "baseDir": './',
      "middleware": [
        log(),
        historyFallback({"index": '/index.html'})
      ]
    },
    "port": 3000
};

Both methods are able to satisfy the goals you mention as it exists today, more or less. A benefit of lite-server is that you have control/flexibility over any future changes to the quickstart server (for any functionaly outside of what browsersync may provide) without requiring changes to the quickstart documentation. And if the crux of matter is simple instructions, I think the lite-server npm package is the way to go.

from lite-server.

johnpapa avatar johnpapa commented on August 20, 2024

If we go the route of lite-server, then we need to expose everything for browser sync and not override it. Plus we'd also need the index.html and port to be flexible. The port should already be in the bs json.

Want to take a stab at a sample for it?

from lite-server.

cgmartin avatar cgmartin commented on August 20, 2024

The PR #16 already exposes everything via a separate (optional) bs-config.js file. As far as duplicating all of browsersync's command line arguments, I'm not in favor. :) Too painful to maintain and keep in sync.

Or maybe I'm missing what you mean by:

expose everything for browser sync and not override it

from lite-server.

johnpapa avatar johnpapa commented on August 20, 2024

I meant that the json file allows all bs properties, but we are setting the port ourselves. so we want to use the bs file instead.

and we should add a fallback file property for cases where folks want something other than the index.html.

from lite-server.

cgmartin avatar cgmartin commented on August 20, 2024

OK, thanks, I think I follow - I'll make modifications to PR #16 and we'll go from there :)

from lite-server.

johnpapa avatar johnpapa commented on August 20, 2024

coolio!

from lite-server.

johnpapa avatar johnpapa commented on August 20, 2024

@cgmartin you may want to add verbose too (see https://github.com/johnpapa/lite-server/pull/24/files)

from lite-server.

cgmartin avatar cgmartin commented on August 20, 2024

Updated PR #16 based on the feedback here. Let me know if this matches what you're looking for.

from lite-server.

johnpapa avatar johnpapa commented on August 20, 2024

Version 2.0 has been published. New API that follows the exact bs-config.js format for all overrides.

from lite-server.

Related Issues (20)

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.