Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs caused by bitrot #7

Merged
merged 3 commits into from
Sep 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"nap"
],
"dependencies": {
"nap": "~0.7.15"
"nap": "0.8.x"
},
"devDependencies": {
"coffee-script": ">1.5",
"vows": "0.7.x",
"vows": "0.8.x",
"wintersmith": "2.x"
},
"author": "Hasan Arous",
Expand Down
15 changes: 10 additions & 5 deletions src/wintersmith-nap.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ module.exports = (env, callback) ->
for ext of napCfg.assets
for section of napCfg.assets[ext]
for index of napCfg.assets[ext][section]
napCfg.assets[ext][section][index] = roots.contents + napCfg.assets[ext][section][index]
napCfg.assets[ext][section][index] = if preview then napCfg.assets[ext][section][index] else roots.contents + napCfg.assets[ext][section][index]

# Setting various `nap` configs
napCfg.appDir = path.resolve(env.workDir, roots.contents);
if preview
napCfg.appDir = path.resolve(env.workDir, roots.contents);
else
napCfg.appDir = env.workDir

napCfg.mode = if preview then 'development' else 'production'
napCfg.publicDir = if preview then roots.contents else roots.output
# napCfg.publicDir = if preview then roots.contents else roots.output
napCfg.publicDir = if preview then '.' else roots.output

# Instantiate nap!
nap napCfg

if preview # development
# Refer to https://github.com/etabits/wintersmith-nap/pull/3#issuecomment-31646159
assetsRx = new RegExp(path.resolve('/assets/', roots.contents)+'/', 'g')
Expand All @@ -43,4 +48,4 @@ module.exports = (env, callback) ->
env.locals.nap = nap

env.logger.info('nap.package()...')
nap.package(callback)
nap.package(callback)