Giter VIP home page Giter VIP logo

webpack-boilerplate's Introduction

webpack-boilerplate

It is a boilerplate applicaiton of webpack projects

It has implemented with latest version of webpack(4) created a component structure with the help of different loaders

Start project

npm start

build project

npm run build

Creating a component

Create your new component directory under component folder eg: navigation

       |-components
            |-navigation
                |-navigation.js
                |-navigation.html
                |-navigation.less

Adding js entry into script.js which is under component folder

    import "./navigation/navigation";

In script.js you can maitain the order of components based on dependency order

Adding less file entry into styles.less which is under component folder

        @import "./navigation/navigation.less";

Here you can maintain the styling order based on dependency

For including the child HTML component in templates ${require('../components/header/header.html')}

Please check html-webpack-plugin and html-loader to know more html component structure

injecting component html into template

${require('../components/header/header.html')} //check index.html under templates folder to see the example

Creating a new template

Create a new teamplate html page in templates folder and make that entry into template-entry.js file to serve the template into build with injecting components. Templates will generate into build folder in "npm start"

    |-templates
        |-products.html

    const templatesList = [
                {path: "./templates/index.html", filename: "index.html"},
                {path: "./templates/products.html", filename: "products.html"} // new entry
            ]

To amend any configuration changes for template generation and html component injection please refer html-webpack-plugin configuration level options at https://github.com/jantimon/html-webpack-plugin#options

webpack-boilerplate's People

Contributors

radhika-a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

muralikanth

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.