jaridmargolin / formatter.js

Format html inputs to match a specified pattern
http://firstopinion.github.io/formatter.js
2.48k stars 235 forks source link

requiring as a CommonJS module doesn't work #61

Open mrak opened 10 years ago

mrak commented 10 years ago

It may be related to how you convert formatter.js to CommonJS, but all of the require statements for internal modules are not using relative paths.

In the main file (dist/common/formatter.js:8-10) the require statements should be like this:

var patternMatcher = require('./pattern-matcher');
var inptSel = require('./inpt-sel');
var utils = require('./utils');

Notice the relative paths being used. The compiled CommonJS files should all be using relative paths for in-module requires :smile:

jaridmargolin commented 10 years ago

Have a fix being used in a few of my smaller libs. Will port over to formatter when time permits. Thank you for reporting.

fampinheiro commented 9 years ago

:+1:

jamuhl commented 9 years ago

+1

Kureev commented 9 years ago

If I'll fix it, would you accept PR?