dustjs
dustjs copied to clipboard
Lack of compile method when used with webpack
I'm using dustjs-linkedin v. 2.7.2 with webpack. When I'm importing dust:
import * as Dust from 'dustjs-linkedin';
or
const Dust = require('dustjs-linkedin');
the imported object doesn't have compile method.
![l_avenir](https://cloud.githubusercontent.com/assets/1297219/24717177/def5c3ce-1a31-11e7-93bf-b1093d9888f3.png)
Is it something webpack specific ?
After some more searching, I'm not the only one that have this problem with dustjs and webpack: http://stackoverflow.com/questions/37592861/dustjs-with-webpack-dont-load-all-files
I also tried to import index.js:
const dust = require('dustjs-linkedin/index.js')
but it gives errors:
Module not found: Error: Can't resolve 'dust.core' in '/Users/apple/Documents/my_projects/repos_arranger_client/node_modules/dustjs-linkedin/lib'
@ ./~/dustjs-linkedin/lib/parser.js 4:4-6:6
@ ./~/dustjs-linkedin/index.js
@ ./src/app/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js
ERROR in ./~/dustjs-linkedin/lib/compiler.js
Module not found: Error: Can't resolve 'dust.core' in '/Users/apple/Documents/my_projects/repos_arranger_client/node_modules/dustjs-linkedin/lib'
@ ./~/dustjs-linkedin/lib/compiler.js 3:4-5:6
@ ./~/dustjs-linkedin/index.js
@ ./src/app/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js
ERROR in ./~/dustjs-linkedin/lib/compiler.js
Module not found: Error: Can't resolve 'dust.parse' in '/Users/apple/Documents/my_projects/repos_arranger_client/node_modules/dustjs-linkedin/lib'
@ ./~/dustjs-linkedin/lib/compiler.js 3:4-5:6
@ ./~/dustjs-linkedin/index.js
@ ./src/app/index.js
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./index.js
I've also checked version 2.7.5. The same story. The only file that seems to be imported is lib/dust.js :(
I have the same issue. Can't get a way to load dust as webpack module. Gives this error:
ERROR in ./~/dustjs-linkedin/lib/compiler.js
Module not found: Error: Can't resolve 'dust.parse' in '(blablabla)\node_modules\dustjs-linkedin\lib'
@ ./~/dustjs-linkedin/lib/compiler.js 3:4-5:6
@ ./spec/client/test-main.js
try adding alias in webpack.config:
alias: { .... "dust.core": "dustjs-linkedin" }
try adding alias in webpack.config:
alias: { .... "dust.core": "dustjs-linkedin" }
i also have the same issue tried alias but did not worked
@Olgagr do you got any solution ?
@rkrishn Unfortunately, it was a long time ago. I don't remember what I did to make it work and I don't have an access to this project any more :( Sorry that I can't help more.
@rkrishn Did you get the solution?I am also stuck on the same issue