You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure that this fixed the issue... (In reference to #15)
I am trying to create a bundle that has an external dependency of famous/famous. But I cannot seem to figure out how to list that as a dependency.
Famous does not list a main in their package.json, so I tried modifying it to:
"main": "src/"
Then I ran:
$ pure-cjs -i ./src/my-main.js -s '{"famous": {"global": "famous", "amd": "famous/src"}}'
Error: Cannot find module 'famous' from 'c:\dev\famous-components\focus-scroll-view'
at Function.module.exports [as sync] (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\resolve\lib\sync.js:35:11)
at Object.exports.getNodePath (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\pathUtils.js:27:36)
at ReplacerMap.<anonymous> (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\replacerMap.js:13:17)
at Array.reduce (native)
at new ReplacerMap (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\replacerMap.js:12:30)
at Object.exports.transformAST (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\index.js:13:9)
at Object.exports.transform (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\index.js:36:17)
at Object.<anonymous> (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\bin\pure-cjs.js:33:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
Even though famous is installed and available under node_modules, it will fail because the resolver.sync will recusively iterate through the folders until it finds a package.json with a file or index.js.
So I created an index.js under src/ and require()'d all of the famous files. However, this still failed with:
$ pure-cjs -i ./src/my-main.js -s '{"famous": {"global": "famous", "amd": "famous/src"}}'
Error: Cannot find module 'famous/core/OptionsManager' from 'c:\dev\famous-components\focus-scroll-view\src'
at Function.module.exports [as sync] (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\resolve\lib\sync.js:35:11)
at Object.exports.getNodePath (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\pathUtils.js:27:36)
at Replacer.getDependency (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\replacer.js:34:32)
at Context.astTypes.visit.visitCallExpression (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\lib\replacer.js:63:14)
at Context.invokeVisitorMethod (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\ast-types\lib\path-visitor.js:259:43)
at Visitor.PVp.visitWithoutReset (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\ast-types\lib\path-visitor.js:143:28)
at visitChildren (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\ast-types\lib\path-visitor.js:179:21)
at Visitor.PVp.visitWithoutReset (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\ast-types\lib\path-visitor.js:151:16)
at NodePath.each (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\ast-types\lib\path.js:96:22)
at visitChildren (c:\Users\Joseph Carroll\AppData\Roaming\npm\node_modules\pure-cjs\node_modules\ast-types\lib\path-visitor.js:162:14)
So instead of pointing directly to the source, I pointed the main to the UMD dist file:
"main": "dist/famous-global.js"
This again failed with the same exception above. I'm not sure what I am doing wrong and I am a little lost at this point.
The project I am trying to build is here: jd-carroll/focus-scroll-view
If you clone the repository locally and run npm install you can follow the steps I've outlined above to reproduce the issue. Since the repository uses bower to manage the famous dependency, you will have to run the following modified script:
So its looking like if you include a UMD external, it is assumed that it only contains a single file. Instead the resolver should inspect the file and load all sub-modules into the map.
Not sure that this fixed the issue... (In reference to #15)
I am trying to create a bundle that has an external dependency of famous/famous. But I cannot seem to figure out how to list that as a dependency.
Famous does not list a
main
in theirpackage.json
, so I tried modifying it to:Then I ran:
Even though famous is installed and available under
node_modules
, it will fail because theresolver.sync
will recusively iterate through the folders until it finds apackage.json
with a file orindex.js
.So I created an
index.js
undersrc/
andrequire()
'd all of the famous files. However, this still failed with:So instead of pointing directly to the source, I pointed the
main
to the UMD dist file:This again failed with the same exception above. I'm not sure what I am doing wrong and I am a little lost at this point.
The project I am trying to build is here: jd-carroll/focus-scroll-view
If you clone the repository locally and run
npm install
you can follow the steps I've outlined above to reproduce the issue. Since the repository usesbower
to manage the famous dependency, you will have to run the following modified script:Any assistance/guidance would be greatly appreciated.
Edit:
Note issue #23
The text was updated successfully, but these errors were encountered: