Closed PaulVML closed 6 years ago
@PaulVML Did you put the rules for pug-as-jsx-loader
in the webpack.config.js
file?
module.exports = {
entry: "...",
output: { /* output options */ },
modules: {
rules: [
{ /* other rules */ },
// Process pug as jsx.
{
test: /\.pug$/,
include: paths.appSrc,
use: [
require.resolve('babel-loader'),
require.resolve('pug-as-jsx-loader'),
],
},
{ /* other rules */ },
]
}
};
And here is a configuration example of webpack.
The rules I have used
{ test: /.pug?$/, exclude: /node_modules/, loaders: ['pug-as-jsx-loader','babel-loader']}
Thx for the quick reply
@PaulVML The order of the loaders seems to be the problem. Change the order of the loader as follows.
{
test: /.pug?$/,
exclude: /node_modules/,
loaders: ['babel-loader', 'pug-as-jsx-loader'],
}
I have a funny feeling it could be due to the version of webpack I am using ...
Thanks for your help.
Pug:
Error Message:
Current Dev Dependencies: