Giter Club home page Giter Club logo

webpack-frontend-template's Introduction

About

Build Status

A webpack starter template for Frontend JavaScript projects using the following technologies:

Typescript

Webpack's ts-loader uses tsc, the TypeScript compiler, and relies on your tsconfig.json configuration to compile .ts files to es2017. ECMAScript 2017 (confusingly known as ES8) was finalized in June 2017.

ES2017 was a tiny release compared to ES6 (ES2015) and introduced async/await, Object.values(), Object.entries() among a few other featuers, hence these features will not be transpiled. Change the target option in the tsconfig.json file to a lower version of JavaScript if you won't to support old Browsers.

Sass

Transforms Sass to CSS.

ESLint & Prettier

ESLint relies on your .eslintrc.cjs config to lint .ts files, and uses the recommended rules. Prettier formats your code and relies on its defaults and the .prettierrc file.

Jest

Jest is a JavaScript Testing Framework and works with Typescript. Tests are written under the test directory.

Environments

You must have NodeJS already installed on your machine, then run npm install before running any other commands.

Development

  • npm run start to start the webpack development server with live reload. Opens your browser at http://localhost:3000
  • npm run lint to lint your code with ESLint.
  • npm run format to format your code with Prettier.
  • npm run test to run tests in watch mode, or npm run test:ci to run tests once.

Production

There are only devDependencies listed in package.json. There are a couple example TS files, styles, and tests that can be deleted but otherwise there are no production dependencies here. Feel free to write vanilla TS or bring in other libraries.

  1. Run npm run build to build project.
  2. Then deploy the generated dist/ directory.

Resources

Webpack

Typescript

ESLint

Prettier

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.