Mar*_*cel 4 javascript shopware
我正在构建一个 Shopware 插件,其中包括店面和管理部分。店面部分工作正常,但我无法使用 Administration:build 命令让管理部分显示在管理页面的菜单中。
我按照 Shopware 文档和 Shopware 课程了解了如何执行此操作。我将它们都匹配了,但仍然没有成功。我这里可能缺少什么吗?
这是我导入插件文件夹的 main.js 文件。
import './module/configurator';
Run Code Online (Sandbox Code Playgroud)
这是我注册插件的插件文件夹中的index.js 文件
import './page/configurator-component-list';
import './page/configurator-component-detail';
import './page/configurator-component-create';
Shopware.Module.register('configurator', {
type: 'plugin',
name: 'Configurator',
color: '#ff3d58',
icon: 'default-shopping-paper-bag-product',
title: 'Configurator',
description: 'Module for registering components',
routes: {
index: {
component: 'configurator-component-list',
path: 'index'
},
detail: {
component: 'configurator-component-detail',
path: 'detail/:id',
meta: {
parentPath: 'configurator.index'
}
},
create: {
component: 'configurator-component-create',
path: 'create',
meta: {
parentPath: 'configurator.index'
}
}
},
navigation: [{
label: 'Configurator',
color: '#ff3d58',
path: 'configurator.index',
icon: 'default-shopping-paper-bag-product',
parent: 'sw-catalogue',
position: 100
}],
});
Run Code Online (Sandbox Code Playgroud)
为了以防万一我的文件树可能有问题,这里是
- administration
- src
- module
- configurator
- page (includes the different components of the plugin)
- index.js
- main.js
- storefront
- src
Run Code Online (Sandbox Code Playgroud)
管理输出:构建
Starting Execution of 'administration:build' ('/var/www/html/dev-ops/administration/actions/build.sh')
(1/3) Starting
> bin/console bundle:dump
Cannot load Xdebug - it was already loaded
[OK] Dumped plugin configuration.
(2/3) Starting
> PROJECT_ROOT=/var/www/html ENV_FILE=/var/www/html/.env npm run --prefix vendor/shopware/platform/src/Administration/Resources/app/administration/ build
> administration@1.0.0 build /var/www/html/vendor/shopware/platform/src/Administration/Resources/app/administration
> mode=production webpack
# Compiling with Webpack configuration
# Production mode is activated
# Plugin "Storefront": Injected successfully
# Plugin "PCvue": Injected successfully
Time: 50301ms
Entrypoint commons = static/js/runtime.js static/css/vendors-node.css static/js/vendors-node.js static/js/vendors-node.js.map static/js/commons.js
Entrypoint app = static/js/runtime.js static/css/vendors-node.css static/js/vendors-node.js static/js/vendors-node.js.map static/css/app.css static/js/app.js
Entrypoint storefront = static/js/runtime.js static/css/vendors-node.css static/js/vendors-node.js static/js/vendors-node.js.map static/css/storefront.css static/js/storefront.js
Entrypoint p-cvue = static/js/runtime.js static/js/p-cvue.js
3847 modules
(3/3) Starting
> bin/console assets:install
Cannot load Xdebug - it was already loaded
Copying files for bundle: FrameworkBundle
Copying files for bundle: MonologBundle
Copying files for bundle: SwiftmailerBundle
Copying files for bundle: SensioFrameworkExtraBundle
Copying files for bundle: TwigBundle
Copying files for bundle: WebProfilerBundle
Copying files for bundle: DebugBundle
Copying files for bundle: EnqueueBundle
Copying files for bundle: EnqueueAdapterBundle
Copying files for bundle: Framework
Copying files for bundle: System
Copying files for bundle: Content
Copying files for bundle: Checkout
Copying files for bundle: Profiling
Copying files for bundle: Administration
Copying files for bundle: Docs
Copying files for bundle: Storefront
Copying files for bundle: Elasticsearch
Copying files for bundle: PCvue
Copying files for bundle: DbalKernelPluginLoader
[OK] Successfully copied all bundle files
Duration: 1m 1s
All commands successfully executed!
Run Code Online (Sandbox Code Playgroud)
我终于(!!)发现了问题。对于任何想知道问题是什么的人。
在index.js中,您需要添加片段:
snippets: {
'de-DE': deDE,
'en-GB': enGB
},
Run Code Online (Sandbox Code Playgroud)
我以前有过这个,但由于我没有使用片段,所以我删除了它们。但这是问题所在。它们不能只包含{ }
它们至少需要包含插件名称
{
'plugin-name': {
}
}
Run Code Online (Sandbox Code Playgroud)
如果没有它们,它将无法正确安装,因此它不会显示在菜单中。幸运的是,他们不会给你一条错误消息来解释一切;)
| 归档时间: |
|
| 查看次数: |
1828 次 |
| 最近记录: |