pugjs / pug-loader

Pug loader module for Webpack
MIT License
425 stars 119 forks source link

URA Error: the "filename" option is required to use includes and extends with "relative" paths #72

Open studentIvan opened 7 years ago

studentIvan commented 7 years ago

ERROR in ./src/index.pug Module build failed: Error: Cannot find module '/Users/studentIvan/projects/frontend/src/node_modules/pug-runtime/index.js'

Why it searching node_modules not in webpack config directory?

I just trying to use jade-loader, and it works very well, with auto replacement, in this configuration:

{
        test: /\.pug/,
        exclude: /node_modules/,
        use: [
          {
            loader: 'file-loader',
            options: {
              name: '[name].html'
            }
          },
          {
            loader: 'extract-loader'
          },
          {
            loader: 'apply-loader'
          },
          {
            loader: 'jade-loader',
            options: {
              pretty: true,
              root: path.resolve(__dirname, 'src')
            }
          },
    ]
}

the same configuration with pug-loader:

ERROR in ./src/index.pug Module build failed: Error: Cannot find module '/Users/studentIvan/projects/frontend/src/node_modules/pug-runtime/index.js'

The real node_modules places inside /Users/studentIvan/projects/frontend/

studentIvan commented 7 years ago

I was trying to use the branch #runtime-url and it works. Can you do it stable and push to npm?