Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 网页包2-文件加载程序[路径]选项_Javascript_Node.js_Webpack_Webpack File Loader - Fatal编程技术网

Javascript 网页包2-文件加载程序[路径]选项

Javascript 网页包2-文件加载程序[路径]选项,javascript,node.js,webpack,webpack-file-loader,Javascript,Node.js,Webpack,Webpack File Loader,我使用webpacks文件加载器从一个文件夹中的pug模板输出一堆编译好的html文件 我想将html文件放在输出目录中,与它们在源/pug/文件夹中时所处的文件夹结构相同,但不包括pug文件夹本身 例如,如果在/pug/文件夹中,一个文件是/pug/layouts/index.pug,另一个文件是/pug/templates/main/index.pug,我试图将输出的html文件发送到/dist/layouts/index.html和/dist/templates/main/index.ht

我使用webpacks文件加载器从一个文件夹中的pug模板输出一堆编译好的html文件

我想将html文件放在输出目录中,与它们在源
/pug/
文件夹中时所处的文件夹结构相同,但不包括pug文件夹本身

例如,如果在
/pug/
文件夹中,一个文件是
/pug/layouts/index.pug
,另一个文件是
/pug/templates/main/index.pug
,我试图将输出的html文件发送到
/dist/layouts/index.html
/dist/templates/main/index.html


我使用的是
文件加载器?name=[path][name].html
,但这样会产生
/dist/pug/layouts/index.html
-注意pug文件夹。我不知道如何摆脱它,有什么想法吗?

结果文件加载器接受一个
context=./path
查询参数

因此,这是有效的
“文件加载器?名称=[path][name].html&context=./pug”