static-dev / spike

A modern static build tool, powered by webpack
http://spike.js.org
Other
470 stars 29 forks source link

Smylink outputDirs for different environments #59

Closed andystevensname closed 7 years ago

andystevensname commented 7 years ago

This might be an odd ask. I'd like to symlink outputDirs into their own repos. Something like this:

|- build/production repo
|- testing repo
|- spike
    |- symlink to build
    |- smylink to testing

If I'm only pointing one of the stock configs' outputDirs, either app.js or app.production.js, to a symlink directory and have the other pointing at any other local directory, things work great. But if both of the outputDirs are symlink directories then an error gets thrown. Any idea why this might be the case?

$ spike compile -e production
/usr/local/lib/node_modules/spike/node_modules/when/lib/decorators/unhandledRejection.js:80
        throw e;
        ^

TypeError: Cannot read property 'error' of undefined
    at processedFiles.forEach (/usr/local/lib/node_modules/spike/node_modules/spike-core/lib/plugin.js:59:16)
    at Array.forEach (native)
    at Compiler.compiler.plugin (/usr/local/lib/node_modules/spike/node_modules/spike-core/lib/plugin.js:52:22)
    at Compiler.applyPluginsAsync (/usr/local/lib/node_modules/spike/node_modules/tapable/lib/Tapable.js:71:13)
    at Compiler.emitAssets (/usr/local/lib/node_modules/spike/node_modules/webpack/lib/Compiler.js:226:7)
    at Compiler.<anonymous> (/usr/local/lib/node_modules/spike/node_modules/webpack/lib/Compiler.js:184:10)
    at /usr/local/lib/node_modules/spike/node_modules/webpack/lib/Compiler.js:403:12
    at Compiler.next (/usr/local/lib/node_modules/spike/node_modules/tapable/lib/Tapable.js:67:11)
    at Compiler.<anonymous> (/usr/local/lib/node_modules/spike/node_modules/webpack/lib/CachePlugin.js:40:4)
    at Compiler.applyPluginsAsync (/usr/local/lib/node_modules/spike/node_modules/tapable/lib/Tapable.js:71:13)
    at Compiler.<anonymous> (/usr/local/lib/node_modules/spike/node_modules/webpack/lib/Compiler.js:400:9)
    at Compilation.<anonymous> (/usr/local/lib/node_modules/spike/node_modules/webpack/lib/Compilation.js:577:13)
    at Compilation.applyPluginsAsync (/usr/local/lib/node_modules/spike/node_modules/tapable/lib/Tapable.js:60:69)
    at Compilation.<anonymous> (/usr/local/lib/node_modules/spike/node_modules/webpack/lib/Compilation.js:572:10)
    at Compilation.next (/usr/local/lib/node_modules/spike/node_modules/tapable/lib/Tapable.js:67:11)
    at Compilation.compilation.plugin (/usr/local/lib/node_modules/spike/node_modules/spike-core/lib/plugin.js:92:9)
jescalan commented 7 years ago

So this particular error indicates a pretty deep and severe internal webpack issue. I'm not entirely sure why this is happening, and unfortunately don't have time to dig in and debug this week at all. You are welcome to dig into the core and get some more details if you want though! I have a full walkthough of the core code here, which should help if you're diving in 😁

https://www.youtube.com/watch?v=r21nwZrCcFc

jescalan commented 7 years ago

Closing due to inactivity