mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
[FIX] add namespaces
This commit is contained in:
parent
042d368c3d
commit
e3b3c1f982
@ -1,3 +1,3 @@
|
|||||||
SilverStripe\SiteConfig\SiteConfig:
|
SilverStripe\SiteConfig\SiteConfig:
|
||||||
extensions:
|
extensions:
|
||||||
- SiteConfigExtension
|
- Site\Extensions\SiteConfigExtension
|
@ -2,7 +2,7 @@
|
|||||||
# with all configuration variables presented
|
# with all configuration variables presented
|
||||||
# Cuz WebPack compiling script use it to set configuration
|
# Cuz WebPack compiling script use it to set configuration
|
||||||
|
|
||||||
WebpackTemplateProvider:
|
Site\Templates\WebpackTemplateProvider:
|
||||||
SRC: site/client/src
|
SRC: site/client/src
|
||||||
DIST: site/client/dist
|
DIST: site/client/dist
|
||||||
HOSTNAME: localhost
|
HOSTNAME: localhost
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Site\Extensions;
|
||||||
|
|
||||||
use SilverStripe\ORM\DataExtension;
|
use SilverStripe\ORM\DataExtension;
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Site\Pages;
|
||||||
|
use Page;
|
||||||
|
|
||||||
class HomePage extends Page
|
class HomePage extends Page
|
||||||
{
|
{
|
||||||
}
|
}
|
@ -1,5 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Site\Pages;
|
||||||
|
use PageController;
|
||||||
|
|
||||||
class HomePageController extends PageController
|
class HomePageController extends PageController
|
||||||
{
|
{
|
||||||
}
|
}
|
11
site/src/Pages/Page.php
Executable file
11
site/src/Pages/Page.php
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// vendor/silverstripe/errorpage/src/ErrorPage.php
|
||||||
|
// extends global Page class
|
||||||
|
//namespace Site\Pages;
|
||||||
|
|
||||||
|
use SilverStripe\CMS\Model\SiteTree;
|
||||||
|
|
||||||
|
class Page extends SiteTree
|
||||||
|
{
|
||||||
|
}
|
11
site/src/Pages/PageController.php
Executable file
11
site/src/Pages/PageController.php
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// vendor/silverstripe/errorpage/src/ErrorPageController.php
|
||||||
|
// extends global PageController class
|
||||||
|
//namespace Site\Pages;
|
||||||
|
|
||||||
|
use SilverStripe\CMS\Controllers\ContentController;
|
||||||
|
|
||||||
|
class PageController extends ContentController
|
||||||
|
{
|
||||||
|
}
|
@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use SilverStripe\CMS\Model\SiteTree;
|
|
||||||
|
|
||||||
class Page extends SiteTree
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use SilverStripe\CMS\Controllers\ContentController;
|
|
||||||
|
|
||||||
class PageController extends ContentController
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,5 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
namespace Site\Templates;
|
||||||
|
|
||||||
use SilverStripe\View\TemplateGlobalProvider;
|
use SilverStripe\View\TemplateGlobalProvider;
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
use SilverStripe\Core\Config\Config;
|
use SilverStripe\Core\Config\Config;
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* Directs assets requests to Webpack server or to static files
|
* Directs assets requests to Webpack server or to static files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace Site\Templates;
|
||||||
|
|
||||||
use SilverStripe\View\TemplateGlobalProvider;
|
use SilverStripe\View\TemplateGlobalProvider;
|
||||||
use SilverStripe\View\Requirements;
|
use SilverStripe\View\Requirements;
|
||||||
use SilverStripe\Control\Director;
|
use SilverStripe\Control\Director;
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
* Load webpack configuration from site/_config/webpack.yml
|
* Load webpack configuration from site/_config/webpack.yml
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const path = require("path");
|
const path = require('path');
|
||||||
const fs = require("fs");
|
const fs = require('fs');
|
||||||
const yaml = require("js-yaml");
|
const yaml = require('js-yaml');
|
||||||
const conf = yaml.safeLoad(fs.readFileSync(path.join(__dirname, "site/_config/webpack.yml"), "utf8"));
|
const conf = yaml.safeLoad(fs.readFileSync(path.join(__dirname, 'site/_config/webpack.yml'), 'utf8'));
|
||||||
|
|
||||||
module.exports = conf.WebpackTemplateProvider;
|
module.exports = conf['Site\\Templates\\WebpackTemplateProvider'];
|
Loading…
Reference in New Issue
Block a user