craigspaeth / nap

Compile, manage, & package stylesheets, javascripts, and javascript templates for node.js
MIT License
122 stars 33 forks source link

Problems debugging #74

Open Agamennon opened 10 years ago

Agamennon commented 10 years ago

I am having a hard debugging my app in webstorm, sometimes the debugger opens the original file in a debug session but sometimes it opens the one at /assets, this translantes to a not ideal debugging experience (maybe i am doing it wrong?) perhaps an option on development to not copy files to a /assets folder but just point to the original locations would be cool. Other then that nap awsome!

craigspaeth commented 10 years ago

Thanks for checking nap out! Can you send me a screen shot or reproducible example of your issue? On my end I'm seeing:

image

image

Which seem to be pretty straightforward debugging for me, but I'm happy to look into making debugging easier on your end.

FWIW if you use the nap middleware it shouldn't write files to /assets which may solve your problem.

Agamennon commented 10 years ago

I am using the middleware, without it my webstorm debugger never works, i forgot to mention that i am using ejs on node to generate the initial page (just the first page, as it is a single page app using angularjs) here is my setup:

app = express(),
http = require('http'),
server = http.createServer(app),
....
app.use(nap.middleware);
nap({
         publicDir: 'myPublicDir',
         mode:'development',
         assets: {
                   js: {
                      stuff:{[myPublicDir/**/*.js]

...... app.locals.nap = nap

and on my page the server side template is an ejs file that in the header portion contains <%- nap.js('stuff') %> if i see the resulting script tag got translated to:

<script src="/assets/myPublicDir/SomeFileOnRoot.js i expected i to be <script src="SomeFileOnRoot.js this is the directory structure: root /backend

maybe it's not supposed to work with ejs?

Agamennon commented 10 years ago

just for testing i switched my templates to jade, unfortunatly with the same results, its gotta be something else, my breakpoints on webstorm are still being opened on the assets file and not the file i am editing.