0.0.1-alpha.8 • Published 7 years ago
protopack v0.0.1-alpha.8
protopack
WORK-IN-PROGRESS. A bundler for prototypes.
npm install protopack --save-devDocumentation
protopack is built on top of rollup, babel, postcss and many other libraries.
Get started
Create a new directory for a prototype. Add a file called .protopack.config.js (or protopack.json):
// .protopack.config.js
'use strict'
module.exports = {
input: './src/index.html',
output: './dist/index.html'
}Create a new directory called src, and add an index.html file to it.
Then call:
NODE_ENV=production npx protopack buildNode.js API
import path from 'path'
import {build} from 'protopack'
const opts = {
cwd: path.resolve(__dirname, '..'),
baseUrl: 'http://localhost:3000'
}
build(opts)
.then(results => {
console.log('Built ok')
})
.catch(err => {
console.error(err)
})Express middleware
import express from 'express'
import path from 'path'
import {middleware} from 'protopack'
const app = express()
const opts = {
cwd: path.resolve(__dirname, '..'),
baseUrl: 'http://localhost:3000'
}
// Use the middleware before routes
app.use(middleware(opts))
app.listen(3000, () => {
console.log('Listening at http://localhost:3000')
})TODO
- Support images
- Support inline styles/scripts (via
inline-source?) - Hot-reloading
- Support custom
babelpresets/plugins - Support custom
postcssplugins - Directory listing
expressmiddleware- Install missing npm modules on
build()
0.0.1-alpha.8
7 years ago
0.0.1-alpha.7
7 years ago
0.0.1-alpha.6
7 years ago
0.0.1-alpha.5
7 years ago
0.0.1-alpha.4
7 years ago
0.0.1-alpha.3
7 years ago
0.0.1-alpha.2
7 years ago
0.0.1-alpha.1
7 years ago