Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.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
Webpack prestashop模块和网页包_Webpack_Vue.js_Prestashop - Fatal编程技术网

Webpack prestashop模块和网页包

Webpack prestashop模块和网页包,webpack,vue.js,prestashop,Webpack,Vue.js,Prestashop,我需要用webpack和vueJS创建prestashop模块,但我找不到一种方法来将其设置在一起。prestashop中的起始文件是modulename.php,webpack中的起始文件是index.html。我不知道如何连接它。即使我尝试将index.html包含到我的主模块文件中,我也没有虚拟标记,也没有通过vueJS创建任何东西(我构建产品) 有什么办法吗?我目前正在研究这个问题,并提出了一些我不太满意的想法,但也许它能有所帮助 在模块文件夹中,我在子文件夹“a”中创建了一个带有vue

我需要用webpack和vueJS创建prestashop模块,但我找不到一种方法来将其设置在一起。prestashop中的起始文件是modulename.php,webpack中的起始文件是index.html。我不知道如何连接它。即使我尝试将index.html包含到我的主模块文件中,我也没有虚拟标记,也没有通过vueJS创建任何东西(我构建产品)


有什么办法吗?

我目前正在研究这个问题,并提出了一些我不太满意的想法,但也许它能有所帮助

在模块文件夹中,我在子文件夹“a”中创建了一个带有vue cli+网页包清单插件的vue项目

我在模块的特定页面中使用此vue项目,该页面由该控制器提供服务:

<?php
class mymodulepageModuleFrontController extends ModuleFrontController
{
    public function initContent()
    {
        parent::initContent();

        $manifest = file_get_contents(__DIR__.'/../../js/A/dist/manifest.json');
        $json = json_decode($manifest, true);

        foreach ($json as $original => $compiled) {
            if (substr($original, -3) === '.js') {
                $uri = '/modules/mymodule/js/A/dist'.$compiled;
                $this->registerJavascript(sha1($uri), $uri, ['position' => 'bottom', 'priority' => 80]);
            } elseif (substr($original, -4) === '.css') {
                $uri = '/modules/mymodule/js/A/dist'.$compiled;
                $this->registerStylesheet(sha1($uri), $uri, ['media' => 'all', 'priority' => 80]);
            }
        }

        $this->setTemplate('module:mymodule/views/templates/front/page.tpl');
    }
}