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

webpack2 #165

Open
andylei18 opened this issue May 10, 2017 · 3 comments
Open

webpack2 #165

andylei18 opened this issue May 10, 2017 · 3 comments

Comments

@andylei18
Copy link

Module not found: Error: Can't resolve 'fs' in node_modules/linebreak/src'
@ .//linebreak/src/linebreaker.js 7:7-20
@ .//react-canvas/lib/measureText.js
@ ./~/react-canvas/lib/ReactCanvas.js

@kaytrance
Copy link

I am having the same error, hoping to get some answer

@twoam
Copy link

twoam commented Jun 20, 2017

If you're not actually relying on the brfs/fs module I think you're safe to adjust the postLoader section specified at https://github.com/Flipboard/react-canvas#using-with-webpack to something like this:

module: {
  postLoaders: [
    {  
      include: __dirname + '/node_modules/linebreak', 
      loader: "transform?brfs" 
    }
  ]
}

This used to work for an older webpack 1.13 project... for which the brfs global npm install also was no longer needed.

@fabiosantoscode
Copy link

^ When using this with webpack 2, if it complains that you're using "import" and "export" then it's acorn and this hasn't been merged yet: browserify/static-module#32. In which case, check workaround inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants