publitas / react-svg-icons

33 stars 11 forks source link

Usage with Webpack #1

Open apreg opened 9 years ago

apreg commented 9 years ago

Hi, I tried to import your module but got errors:

WARNING in ./~/recursive-readdir/~/minimatch/minimatch.js
Critical dependencies:
6:5-12 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/recursive-readdir/~/minimatch/minimatch.js 6:5-12

WARNING in ./~/babel-core/lib/transformation/file/index.js
Critical dependencies:
537:33-45 the request of a dependency is an expression
 @ ./~/babel-core/lib/transformation/file/index.js 537:33-45

WARNING in ./~/recursive-readdir/~/minimatch/LICENSE
Module parse failed: c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\LICENSE Line 1: Unexpected number
You may need an appropriate loader to handle this file type.
| Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
| All rights reserved.
|
 @ ./~/recursive-readdir/~/minimatch ^\.\/.*$

WARNING in ./~/recursive-readdir/~/minimatch/README.md
Module parse failed: c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\README.md Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # minimatch
|
| A minimal matching utility.
 @ ./~/recursive-readdir/~/minimatch ^\.\/.*$

WARNING in ./~/babel-core/lib/transformation/file/plugin-manager.js
Critical dependencies:
141:19-31 the request of a dependency is an expression
 @ ./~/babel-core/lib/transformation/file/plugin-manager.js 141:19-31

WARNING in ./~/try-resolve/index.js
Critical dependencies:
5:24-31 require function is used in a way in which dependencies cannot be statically extracted
 @ ./~/try-resolve/index.js 5:24-31

WARNING in ./~/babel-core/lib/transformation/file/README.md
Module parse failed: c:\WORKSPACE\JS\hbg\node_modules\babel-core\lib\transformation\file\README.md Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| ## File Transformation
|
| This is the File Transformation directory.
 @ ./~/babel-core/lib/transformation/file ^\.\/.*$

WARNING in ./~/babel-core/lib/transformation/file/options/README.md
Module parse failed: c:\WORKSPACE\JS\hbg\node_modules\babel-core\lib\transformation\file\options\README.md Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| ## File Options
|
| This is the File Options directory.
 @ ./~/babel-core/lib/transformation/file ^\.\/.*$

WARNING in ./~/try-resolve/README.md
Module parse failed: c:\WORKSPACE\JS\hbg\node_modules\try-resolve\README.md Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # try-resolve
|
| ## Installation
 @ ./~/try-resolve ^\.\/.*$

ERROR in ./~/recursive-readdir/~/minimatch/test/caching.js
Module not found: Error: Cannot resolve module 'tap' in c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\test
 @ ./~/recursive-readdir/~/minimatch/test/caching.js 2:10-24

ERROR in ./~/recursive-readdir/~/minimatch/test/brace-expand.js
Module not found: Error: Cannot resolve module 'tap' in c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\test
 @ ./~/recursive-readdir/~/minimatch/test/brace-expand.js 1:10-24

ERROR in ./~/recursive-readdir/~/minimatch/test/extglob-ending-with-state-char.js
Module not found: Error: Cannot resolve module 'tap' in c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\test
 @ ./~/recursive-readdir/~/minimatch/test/extglob-ending-with-state-char.js 1:11-25

ERROR in ./~/recursive-readdir/~/minimatch/test/basic.js
Module not found: Error: Cannot resolve module 'tap' in c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\test
 @ ./~/recursive-readdir/~/minimatch/test/basic.js 6:10-24

ERROR in ./~/recursive-readdir/~/minimatch/test/defaults.js
Module not found: Error: Cannot resolve module 'tap' in c:\WORKSPACE\JS\hbg\node_modules\recursive-readdir\node_modules\minimatch\test
 @ ./~/recursive-readdir/~/minimatch/test/defaults.js 6:10-24

I'm using Webpack. Do you have an idea what's wrong?

MMRandy commented 9 years ago

+1 Love to know how to use this with Webpack.

felixhageloh commented 9 years ago

Nice to see that people are using this! I know very little about WebPack, but this module relies on browserify transforms so I am not surprised it doesn't work with WebPack. I will check if there is an easy way to support WebPack - suggestions welcome!

apreg commented 9 years ago

About transform in Webpack: https://gist.github.com/substack/68f8d502be42d5cd4942#transforms-instead-of-loaders https://webpack.github.io/docs/webpack-for-browserify-users.html#transform

derekrushforth commented 9 years ago

+1. Trying to use this with Webpack but I'm getting the same error.

jeremyfrank commented 8 years ago

+1

ixax commented 8 years ago

+1

slightlytyler commented 8 years ago

I've packaged this as a commonjs module that does not require browserify. All those using webpack rejoice! https://github.com/slightlytyler/react-svgcon

@felixhageloh If you would like to collaborate on a single, bundler agnostic package I'd be down

felixhageloh commented 8 years ago

Great @slightlytyler! Yeah at the moment I have very little time to look into this. We might be using this internally soon again tho, so potentially there will be more effort and focus on this module again!