зеркало из https://github.com/nextcloud/text.git
Merge pull request #6026 from nextcloud/chore/extract-css
This commit is contained in:
Коммит
98af8c4963
|
@ -144,6 +144,7 @@ class TextDirectEditor implements IEditor {
|
|||
$this->initialStateProvider->provideDirectEditToken($token->getToken());
|
||||
$this->initialStateProvider->provideState();
|
||||
Util::addScript('text', 'text-text');
|
||||
Util::addStyle('text', 'text-text');
|
||||
return new TemplateResponse('text', 'main', [], 'base');
|
||||
} catch (InvalidPathException $e) {
|
||||
} catch (NotFoundException $e) {
|
||||
|
|
|
@ -30,6 +30,9 @@ class FilesLoadAdditionalScriptsListener implements IEventListener {
|
|||
|
||||
\OCP\Util::addInitScript('text', 'text-init');
|
||||
\OCP\Util::addScript('text', 'text-files');
|
||||
// Add associated styles
|
||||
\OCP\Util::addStyle('text', 'text-init');
|
||||
\OCP\Util::addStyle('text', 'text-files');
|
||||
|
||||
$this->initialStateProvider->provideState();
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ class FilesSharingLoadAdditionalScriptsListener implements IEventListener {
|
|||
}
|
||||
|
||||
Util::addScript('text', 'text-public');
|
||||
Util::addStyle('text', 'text-public');
|
||||
|
||||
$this->initialStateProvider->provideState();
|
||||
$node = $event->getShare()->getNode();
|
||||
|
|
|
@ -35,5 +35,6 @@ class LoadEditorListener implements \OCP\EventDispatcher\IEventListener {
|
|||
|
||||
$this->initialStateProvider->provideState();
|
||||
Util::addScript('text', 'text-editors');
|
||||
Util::addStyle('text', 'text-editors');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ class LoadViewerListener implements IEventListener {
|
|||
return;
|
||||
}
|
||||
Util::addScript('text', 'text-viewer', 'viewer');
|
||||
Util::addStyle('text', 'text-viewer');
|
||||
$this->eventDispatcher->dispatchTyped(new RenderReferenceEvent());
|
||||
|
||||
$this->initialStateProvider->provideState();
|
||||
|
|
|
@ -5,8 +5,6 @@ import { createAppConfig } from '@nextcloud/vite-config'
|
|||
import { webpackStats } from 'rollup-plugin-webpack-stats'
|
||||
import path from 'path'
|
||||
|
||||
const ENTRIES_TO_INCLUDE_CSS = ['text', 'public', 'viewer', 'editors']
|
||||
|
||||
const config = createAppConfig({
|
||||
text: path.join(__dirname, 'src', 'main.js'),
|
||||
files: path.join(__dirname, 'src', 'files.js'),
|
||||
|
@ -15,11 +13,7 @@ const config = createAppConfig({
|
|||
editors: path.join(__dirname, 'src', 'editor.js'),
|
||||
init: path.join(__dirname, 'src', 'init.js'),
|
||||
}, {
|
||||
inlineCSS: {
|
||||
jsAssetsFilterFunction: ({ name }) => {
|
||||
return ENTRIES_TO_INCLUDE_CSS.includes(name)
|
||||
}
|
||||
},
|
||||
createEmptyCSSEntryPoints: true,
|
||||
config: {
|
||||
resolve: {
|
||||
dedupe: ['vue'],
|
||||
|
@ -33,6 +27,7 @@ const config = createAppConfig({
|
|||
webpackStats(),
|
||||
],
|
||||
build: {
|
||||
cssCodeSplit: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: (id) => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче