1

I am trying to load handlebars-loaderenter code here, but my app hangs. It loads app.bundle.js but then not execute any futher scripts. There is no output in console.

module.exports = {
     module: {
         loaders: [{
                 exclude: /node_modules/,
                 loader: 'handlebars-loader'
             }, {
                 test: /\.js$/,
                 exclude: /node_modules/,
                 loader: 'babel-loader'
             }]
     }
};

When I try to load handlebars via plugin:

plugins: [
          new webpack.ProvidePlugin({
             handlebars: "handlebars",
             "windows.handlebars": "handlebars"
         })
     ],

I have handlevars defuned but webpack gives the error after compilation:

ERROR in ./~/handlebars/lib/index.js
Module not found: Error: Can't resolve 'fs' in 'E:\Dev\Micron\node_modules\handlebars\lib'
 @ ./~/handlebars/lib/index.js 17:11-24
 @ ./src/core/index.js
 @ ./src/app.js

How can I laod handlebars via webpack?

Michał Wojas
  • 509
  • 1
  • 5
  • 16

0 Answers0