Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
fix(modules): resolve babel-runtime etc. from meteor bundle
Browse files Browse the repository at this point in the history
i.e. from
* `build/meteor/bundle/programs/server/node_modules`
* `build/meteor/bundle/programs/server/npm/node_modules`

instead of from root `node_modules`.  Hopefully this will solve #162
by avoiding duplicate instances of `Promise`, `Fiber`, etc.
  • Loading branch information
jedwards1211 committed Jun 7, 2017
1 parent 52ee42f commit 1c57a48
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"presets": ["es2015", "stage-1", "react", "flow"],
"plugins": [
"transform-runtime",
"meteor-imports"
"transform-runtime"
],
"env": {
"coverage": {
Expand All @@ -16,4 +15,5 @@
]
}
}
}
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint:watch": "esw -w *.js src scripts test util webpack"
},
"dependencies": {
"babel-runtime": "^6.11.6",
"babel-plugin-module-resolver": "^2.7.1",
"bcrypt": "^1.0.1",
"debug": "^2.5.2",
"es6-promisify": "^5.0.0",
Expand Down
12 changes: 12 additions & 0 deletions src/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../.babelrc",
"plugins": [
"meteor-imports",
["module-resolver", {
"root": [
"./build/meteor/bundle/programs/server/node_modules",
"./build/meteor/bundle/programs/server/npm/node_modules"
]
}]
]
}
3 changes: 1 addition & 2 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import path from 'path'
import createSSR from './createSSR'
import { WebApp } from 'meteor/webapp'
import createDebug from 'debug'
import Fiber from 'fibers'

const buildDir = process.env.BUILD_DIR
if (!buildDir) throw new Error("missing process.env.BUILD_DIR")
Expand Down Expand Up @@ -39,7 +38,7 @@ app.get('*', (req: Object, res: Object, next: Function) => {
next()
return
}
Fiber((): void => createSSR(req, res)).run()
createSSR(req, res)
})

WebApp.rawConnectHandlers.use(app)
Expand Down

0 comments on commit 1c57a48

Please sign in to comment.