Comments (3)
For the first error you need to use the json-loader
.
The second one is here: module.paths
is not supported (is not even documented in the node.js documentation and it's not good style).
I would love to have more time to maintain enhanced-require, but webpack gets more traction and eats up my whole time...
from enhanced-require.
You also need to add extensions: ['', '.js', '.json'],
to your webpack config. I'm also having problems on node.js... Not easy to fix.
from enhanced-require.
Interesting approach @ianbytchek. I was running into a similar issue around require.context when trying to run mocha tests on the browser. The command I ran was node node_modules/enhanced-require/bin/enhanced-require.js "mocha\!./test/index.js"
and it errors with:
node node_modules/enhanced-require/bin/enhanced-require.js "mocha\!./test/index.js"
TypeError: Object #<Object> has no method 'ui'
at Object.Mocha (/Users/dmarr/src/webpack-with-common-libs/node_modules/mocha/lib/mocha.js:83:8)
at WEBPACK_CORE_LOADER_EXECUTION (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:131:71)
at runSyncOrAsync (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:131:93)
at nextLoader (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:233:3)
at Storage.finished (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
at SyncNodeJsInputFileSystem.readFile (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/SyncNodeJsInputFileSystem.js:19:4)
at Storage.provide (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:56:2)
at CachedInputFileSystem.readFile (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:134:24)
at NormalModuleMixin.onLoadPitchDone (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:204:7)
at NormalModuleMixin.loadPitch (/Users/dmarr/src/webpack-with-common-libs/node_modules/enhanced-require/node_modules/webpack-core/lib/NormalModuleMixin.js:157:27)
I guess this is mocha-loader's fault but i'm not certain. I filed a bug there: webpack-contrib/mocha-loader#17
from enhanced-require.
Related Issues (14)
- Issue loading jade templates HOT 2
- Node fibers throw an error when used with enhanced require
- module.paths API is missing
- Updates required to get this up-to-date
- SyntaxError: Unexpected token ILLEGAL with java node_module HOT 1
- If this lib is CURRENTLY UNMAINTAINED, then what I should do to use webpack client side files in node.js? HOT 9
- The code for "startup your application" makes very little sense.
- Requiring relative to subtype HOT 4
- doesn't support emitFile HOT 4
- Define loaders in options HOT 2
- Amd module with return doesn't get populated on node.js HOT 1
- Add a global var named __webpack_public_path__ in order to play nice with other loaders (file-loader) HOT 2
- Resolver plugin not working HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enhanced-require.