Comments (6)
interesting, can you try running it again, this time with:
DEBUG=koa-bundle* node index.js
from bundle.
> [email protected] start /Users/nexus/Public/standard-signature
> node lib/
koa-router defined route /app(.*) +0ms
koa-router defined route HEAD,GET /app/ +3ms
koa-redis Init redis new client +6ms
koa:application use - +14ms
koa:application use logger +1ms
koa:application use - +5ms
koa-better-static static "/Users/nexus/Public/standard-signature/static-assets" {"maxage":86400000} +1ms
koa:application use serve +0ms
'TypeError: Path must be a string. Received undefined\n at assertPath (path.js:8:11)\n at posix.join (path.js:479:5)\n at fullpath (/Users/nexus/Public/standard-signature/node_modules/koa-bundle/index.js:429:30)\n at entry (/Users/nexus/Public/standard-signature/node_modules/koa-bundle/index.js:120:12)\n at _bundle (/Users/nexus/Public/standard-signature/node_modules/koa-bundle/index.js:88:19)\n at Object.<anonymous> (/Users/nexus/Public/standard-signature/src/index.js:196:9)\n at Module._compile (module.js:398:26)\n at Object.Module._extensions..js (module.js:405:10)\n at Module.load (module.js:344:32)\n at Function.Module._load (module.js:301:12)\n at Function.Module.runMain (module.js:430:10)\n at startup (node.js:141:18)\n at node.js:980:3'
from bundle.
It gets an error before any debugging occurs; I've reproduced this bug.
from bundle.
It's saying that the root is undefined
from bundle.
Okay I'll submit a documentation update, You just have to specify a root
property in your options along with stuff like debug: true
from bundle.
Here's how I get scripts to get dynamically loaded:
let bundle = new Bundle({
debug: true,
root: __dirname
}, function(file, fn) {
Browserify({ debug: file.debug })
.add(file.path)
.transform(babelify)
.bundle(fn);
});
// this is a middleware that makes your scripts
// dir get served up as browserified/babelified
app.use(async function(ctx, next) {
if (ctx.path.indexOf('/scripts/') !== 0)
return next();
let ext = path.extname(path.basename(ctx.path));
if (ext !== '.js')
return next();
try {
await convert(bundle(ctx.path))(ctx, next);
} catch (err) {
ctx.throw(404);
}
});
from bundle.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bundle.