A
A
Askar Mukhametshin2016-07-26 12:28:01
Pug
Askar Mukhametshin, 2016-07-26 12:28:01

How to make bemto & pug friends?

bemto is installed in node_modules and is included in the project using webpack. But an error is thrown:

ERROR in   Error: Child compilation failed:
  Module build failed: Error: Cannot resolve 'file' or 'directory' ./helpers.pug in D:\Projects\nogai-history\node_modules\bemto.jade\lib

  - Resolver.js:124
    [nogai-history]/[enhanced-resolve]/lib/Resolver.js:124:15

  - Resolver.js:191
    [nogai-history]/[enhanced-resolve]/lib/Resolver.js:191:15

  - Resolver.js:110 applyPluginsParallelBailResult.createInnerCallback.log
    [nogai-history]/[enhanced-resolve]/lib/Resolver.js:110:4

и т.д...

The problem is that pug
include helpers
tries to recognize constructs like: as an attempt to connect a pug file, and not jade, although the connection goes exactly to the jade file. How to solve this problem?
Here is the pug file:
include ~bemto.jade

body
  +b.header
    +e.search Test

Here is the webpack config:
var BowerWebpackPlugin = require('bower-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  entry: './app/main',
  output: {
    path: __dirname + '/dist',
    filename: 'script.js'
  },

  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /(node_modules|bower_components)/,
        loader: 'babel?presets[]=es2015'
      },
      {
        test: /\.(pug|jade)/,
        loader: 'pug'
      }
    ]
  },

  plugins: [
    new BowerWebpackPlugin(),
    new HtmlWebpackPlugin({
      template: './app/main.jade',
      filename: 'index.html'
    })
  ]
};

PS And what's going on? Changed all extensions to pug, so he swears at inserting scripts.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Eremenko, 2016-11-11
@Maskazan

Either rename files to node_modules/bemto.jade/lib/*.jade -> *.pug,
or add .pug extension to include's -> include helpers.pug
---
In general https://github.com/kizu/ bemto/issues/81

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question