Git Product home page Git Product logo

udk's Introduction

Universal Development Kit

Webpack extension which improves universal application development.

NPM Version NPM Dependencies Build Status Coverage Status License: MIT

Features

Install

npm install --save-dev udk webpack

The Gist

// webpack.config.js

const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development';

const client = {
  name: 'client',
  entry: './src/client.js',
  output: {
    path: __dirname + '/dist',
    filename: 'client.js'
  }
};

const server = {
  name: 'server',
  dependencies: [ client.name ], // server depends on client
  entry: './src/server.js',
  output: {
    path: __dirname + '/dist',
    filename: 'server.js'
  }
};

module.exports = [ client, server ]; // webpack multi config
// src/client.js

import './shared';

console.log('Hello, client');
// src/server.js

import './shared';

console.log('Hello, server');
// src/shared.js

console.log('Hello, shared');
DEBUG=udk:* npx udk --config webpack.config.js --watch

Now, try to update each file and check the output:

  1. update client.js to check that server compiler will be invalidate when client compiler done ;
  2. update server.js to check that sever compiler will be the only one compiler invalided ;
  3. update shared.js to check that server compiler will wait client compiler done before compile too ;
  4. update shared.js with a syntax error to check that server won't compile because client compiler has error ;
  5. update shared.js to fix syntax error and check client and server compilers will run in serie.

Run webpack --config webpack.config.js --watch and try the same updates to check the difference between webpack and udk multi compiler behavior.

Under the hood, udk extends MultiCompiler only to ensure some behaviors:

  • Invalidate compiler dependants when a compiler done ;
  • Interupt compilation if a compiler dependency has stats errors ;
  • Wait compiler dependency done when a shared file are updated.

Command Line Interface

udk.js

Same as webpack CLI.

udk [--config webpack.config.js]
udk <entry> [<entry>] <output>

All webpack CLIs are supported:

Node.js API

See docs/api.md.

FAQ

See docs/faq.md.

DevContainer

See docs/dev-container.md.

Implementation

See docs/implementation.md.

License

MIT

udk's People

Contributors

enten 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.