@transclusion/work
**_It just works_ so you can stop configuring and get s\*\*t done!**
Last updated 10 hours ago by mariuslundgard .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @transclusion/work 
SYNC missed versions from official npm registry.

work

It just works so you can stop configuring and get s**t done!

NOTE: @transclusion/work is currently in alpha.

What is this?

@transclusion/work is a runtime that provides a highly opinionated environment for quickly developing web apps with Node.js. Becauce it’s built on top of micro, it works particularly well with the now platform.

What does it do?

  • Understanding both modern JavaScript and TypeScript (with no configuration). Since it uses rollup under the hood, the bundles are as small and optimized and possible.
  • Running a development server with hot-reloading.
  • Running a production server with highly optimized configuration.

Get started

First install work:

npm install @transclusion/work

Create a file called work.config.js in the root of the project:

module.exports = {
  builds: [
    {src: './browser.js', target: 'browser', dir: './dist/static'},
    {src: './server.js', target: 'server', dir: './dist'}
  ],
  routes: [
    { src: '/static/(.*)', dest: './dist/static/$1' },
    { src: '(.*)', dest: './dist/server.js' }
  ],
  extendRollup(rollupConfig) {
    // extend rollup config if needed
    return {...rollupConfig}
  }
}

Create a file named browser.js:

document.body.innerHTML = 'Hello from the browser'

Create a file named server.js:

module.exports = function (req, res) {
  res.writeHead(200, { 'content-type': 'text/html' })
  res.end(`<!doctype html>
<html>
  <body>
    Hello from the server
    <script src="/static/browser.js"></script>
  </body>
</html>`)
}

Run the development server:

npx work dev
# Listening at http://localhost:3000

Current Tags

  • 1.0.0-alpha.11                                ...           latest (10 hours ago)

12 Versions

  • 1.0.0-alpha.11                                ...           10 hours ago
  • 1.0.0-alpha.10                                ...           11 hours ago
  • 1.0.0-alpha.9                                ...           a month ago
  • 1.0.0-alpha.8                                ...           a month ago
  • 1.0.0-alpha.7                                ...           a month ago
  • 1.0.0-alpha.6                                ...           a month ago
  • 1.0.0-alpha.5                                ...           a month ago
  • 1.0.0-alpha.4                                ...           a month ago
  • 1.0.0-alpha.3                                ...           a month ago
  • 1.0.0-alpha.2                                ...           a month ago
  • 1.0.0-alpha.1                                ...           a month ago
  • 1.0.0-alpha.0                                ...           a month ago
Maintainers (1)
Downloads
Today 0
This Week 21
This Month 21
Last Day 20
Last Week 0
Last Month 152
Dependencies (18)
Dev Dependencies (21)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |