Giter Club home page Giter Club logo

svelte-webpack-babel-scss's Introduction

Svelte webpack-babel-scss app

This is a project template for Svelte apps. It lives at https://github.com/markoboy/svelte-webpack-babel-scss. It is an expansion of https://github.com/sveltejs/template-webpack repository.

To create a new project based on this template using degit:

npx degit markoboy/svelte-webpack-babel-scss svelte-app
cd svelte-app

Note that you will need to have Node.js installed.

Table of Contents

Get started

(Back to top)

Install the dependencies...

cd svelte-app
npm install

...then start webpack:

npm start

Navigate to localhost:8080. You should see your app running. Edit a component file in src, save it, and the page should reload with your changes.

Application running

Deploying to the web

With now

(Back to top)

Install now if you haven't already:

npm install -g now

Then, from within your project folder:

now

Find out more at now website.

As an alternative, use the Now desktop client and simply drag the unzipped project folder to the taskbar icon.

With surge

(Back to top)

Install surge if you haven't already:

npm install -g surge

Then, from within your project folder:

npm run build
surge public

Find out more at surge website.

Folder structure

(Back to top)

An overview of the folder structure that comes with this template:

svelte-webpack-babel-scss
│   README.md
│   svelte.config.js
│   webpack.config.js
│   babel.config.js
│   config files...
│
└───public
│   │   logo.png
│   │
│   └───dist
│   │   boundle files...
│
└───src
    │   index.html  // Html file used by webpack
    │   main.js     // Main entry file used by webpack
    │   app.scss    // Global scss file used by the app
    │   app.svelte  // Main application component used by the entry file
    │
    └───components    // Each component is stored in a separate folder with *.svelte and *.scss file
    │   └───component-name
    │   │   component-name.svelte
    │   │   component-name.scss
    │
    └───models    // Each javascript model (class) should be stored here
    │   model.js
    │
    └───scss    // All scss styling that can be injected in components or globally
    │   └───base
    │   └───layout
    │   └───mixins
    │   └───modules
    │   └───theme
    │   _essential.scss   // Should contain theming/mixins and styles that can be shared with application and components
    │   application.scss  // Global scss styles
    │
    └───stores    // All stores stored here
    │   store.js
    │
    └───utils   // All utility functions
    │   util.js
    │
    └───views   // All views of the application
    │   └───view-name
    │   │   view-name.svelte
    │   │   view-name.scss

This template has a few utilities, scss, views and components to demonstrate their usage. Any pull request is welcomed. Open an issue ticket if you have any problems.

Available npm scripts

(Back to top)

npm run description
start Starts the dev server
build Bundles production build
build:dev Bundles dev build (Usefull to check js output)
serve Bundles production build and serves with serve package
lint Lints the src folder
lint:watch Lints and watches the src folder

Depedencies used

(Back to top)

For more information for the packages check package.json

VSCode extensions

(Back to top)

Todo

(Back to top)

  • Webpack
  • Update README file
  • Jsconfigs for VSCode
  • VSCode folder with settings
  • Babel
  • Eslint
  • Scss
  • Jest

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.