Question: I'm bundling a typescript project, and webpack fails with the error
`ERROR in (webpack)/lib/NormalModule.js
Module not found: Error: Can't resolve 'module' in 'C:\SPA\MyApp\node_modules\webpack\lib'
 @ (webpack)/lib/NormalModule.js 91:16-33`

If I hack the module from 
`var Module = require("module");`
to 
`var Module = require("./module");` 
the problem is resolved.

Does anyone have any idea what might be causing this to be an issue? It seems odd that nobody else is reporting this as an issue.
The line in question is here:
<https://github.com/webpack/webpack/blob/master/lib/NormalModule.js#L90>

Answer: 
For a beginner the following would be enough.

```
├── Gemfile
├── Gemfile.lock
├── app.rb
├── config.rb
└── lib/
    ├── lib1.rb
    ├── lib2.rb

```

where app.rb is you main file and you run the project using

ruby app.rb

lib/
has you library files lib1.rb and lib2.rb

suppose you are tweeting through your app then lib1.rb could be tweet.rb
I recommend using **Hoe**: <https://github.com/seattlerb/hoe>

> 
> Hoe focuses on keeping everything in its place in a useful form and
>  intelligently extracting what it needs. As a result, there are no
>  extra YAML files, config directories, ruby files, or any other
>  artifacts in your release that you wouldn't already have.
> 
> 
> 

What I like is that the test directory is setup by default, and running `rake` will run the tests. I require my `lib/project_name.rb` and fill in the tests.

A Hoe setup includes a Rakefile. Rake is maintained by the same group behind Hoe, Seattle.rb. Info: <https://github.com/ruby/rake>; docs: <http://docs.seattlerb.org/rake/>

Hoe allows you to turn your project into a Gem if applicable to your use case.

Hoe has a bunch of plugins:

> 
> Hoe has a flexible plugin system that allows you to activate and
>  deactivate what tasks are available on a given project. Hoe has been
>  broken up into plugins partially to make maintenance easier but also
>  to make it easier to turn off or replace code you don't want.
> 
> 
> 

*[Plus it's written by hardcore rubyists Ryan Davis (author of MiniTest) and Eric Hodel, so the code is bulletproof and the repo stays maintained.](https://github.com/seattlerb/hoe/graphs/contributors)*

---

**Structure Overview**

```
project_dir/
  History.txt
  Manifest.txt
  README.txt
  Rakefile
  bin/...
  lib/...
  test/...

```

---

**Installation & Setup**

Install via command line:

```
gem install hoe

```

Setup a project:

```
sow project_name

```

---

**Documentation**

* <http://docs.seattlerb.org/hoe/>
* <http://docs.seattlerb.org/hoe/Hoe.pdf>

[![Hoe Documentation PDF](https://i.stack.imgur.com/aWQhO.png)](https://i.stack.imgur.com/aWQhO.png)