using this pug-plugin package with TypeScript gives an error. I would like to understand how can TypeScript be used in the pug-plugin package?
new PugPlugin({
pretty: true, // formatting HTML, useful for development mode
verbose: true,
js: {
// output filename of extracted JS file from source script
filename: 'js/[name].js',
},
css: {
// output filename of extracted CSS file from source style
filename: 'css/[name].css',
},
}),
{
test: /\.pug$/,
oneOf: [
// import Pug in JavaScript/TypeScript as template function
{
issuer: /\.(js|ts)$/,
loader: PugPlugin.loader,
options: {
method: 'compile',
esModule: true,
},
},
// render Pug from Webpack entry into static HTML
{
loader: PugPlugin.loader,
options: {
method: 'compile',
data: {
listLinks: links,
},
embedFilters: {
escape: true,
},
// compileDebug: true,
},
},
],
},
ERROR in ./src/app/app.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: TypeScript emitted no output for /home/abstract13/Общедоступные/PhpstormProjects/AAtheBestPractics/src/app/app.ts.
at makeSourceMapAndFinish (/home/abstract13/Общедоступные/PhpstormProjects/AAtheBestPractics/node_modules/ts-loader/dist/index.js:52:18)
at successLoader (/home/abstract13/Общедоступные/PhpstormProjects/AAtheBestPractics/node_modules/ts-loader/dist/index.js:39:5)
at Object.loader (/home/abstract13/Общедоступные/PhpstormProjects/AAtheBestPractics/node_modules/ts-loader/dist/index.js:22:5)
@ ./src/pages/index/index.pug 4793:56-157
Hello,
using this pug-plugin package with TypeScript gives an error. I would like to understand how can TypeScript be used in the pug-plugin package?
Thanks