GithubHelp home page GithubHelp logo

johnapache / koa-webpack-middleware Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 144 KB

提供 了 koa版本的webpack 开发 插件, webpack-dev-middleware 和 webpack-hot-middleware等,同时支持ts版本

License: MIT License

HTML 5.30% JavaScript 38.23% CSS 4.41% TypeScript 52.06%
koa-webpack-middleware koa-webpack-dev-middleware koa-webpack-hot-middleware webpack-dev-middleware webpack-hot-middleware

koa-webpack-middleware's Introduction

koa-webpack-middleware

提供了Koa版本的webpack 开发插件, webpack-dev-middleware 和 webpack-hot-middleware等,同时支持ts

使用方式

const Koa = require('koa');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config');
const {koaWebpackDevMiddleware, koaWebpackHotMiddleware} = require('../dist/koa-webpack-middleware');
const app = new Koa();
const compiler = webpack(webpackConfig);

app.use(koaWebpackDevMiddleware(compiler, {
    host: 'localhost',
    contentBase: './dist',
    log: false,
    stats: {
        colors: true,
        process: true
    }
}))

app.use(koaWebpackHotMiddleware(compiler, {
    log: false,
    path: "/__webpack_hmr",
    heartbeat: 2000,
}))

app.listen(9999, () => {
    console.log('server is running on port: 9999');
})

koa-webpack-middleware's People

Watchers

 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.