Code Monkey home page Code Monkey logo

fetch-hotels's Introduction

Webpack boilerplate

Webpack config that uses sass to convert .scss to .css and transform newer (ES6 and up) JavaScript with babel

**If you want to change the html, change the file: index.ejs. And your main entry point for writing javascript is in app.js.

In app.js I have imported main.scss so webpack will convert the scss-files and output them as styles.css in dist-folder. As long as you don't delete that line you should just be able to write scss and js as usual. Your finshed files are located inside of the dist-folder.

Installation

  1. Clone this repository
  2. cd into the folder webpack-boilerplate that is created when cloning
  3. Install all dependencies with npm
npm install

Usage

Development

To run development server on localhost (you can choose port of your choice in the config-file)

npm run dev

Production

To create a production ready build that is minified and properly packed:

npm run build

Packages used

  • Webpack
    • Webpack handles converting and packaging all the resources in your project so they can be read by a browser.
  • Webpack-dev-server
    • Webpack does not handle creating a localhost and serving the content, you need to have a separate module that handles reloading and updating the page when in development mode
  • Webpack Dashboard
    • yeah this is just for show, a cool dashboard, doesn't do anything special
  • Webpack Babel Loader
    • Handles converting JavaScript with Babel
  • Style-loader
    • Handles <style>-tags and inserting css via webpack. Needed for loading CSS
  • CSS-loader
    • Makes it possible to do import './styles.css inside our app.js-file. Without this loader, webpack does not know how to handle .css-files.
  • Sass-loader
    • Makes it possible to do import './styles.scss inside our app.js-file. Without this loader, webpack does not know how to handle .scss-files.
  • ExtractTextPlugin
    • By default, webpack inlines css into your JavaScript, it does not actually create a .css-file. This plugin handles extracting the css into a separate file.
  • HtmlWebpackPlugin
  • This plugin handles creating a index.html from index.ejs. This is mainly so we don't have to handle linking and moving our files, webpack moves and inserts script-tags for us.

fetch-hotels's People

Contributors

unnilstudios avatar

Watchers

James Cloos avatar

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.