1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-25 06:03:36 +03:00

F #5422: Fix css imports (#1444)

This commit is contained in:
Jorge Miguel Lobo Escalona 2021-09-08 10:44:33 +02:00 committed by GitHub
parent 9aef4d8430
commit 3d4b4fba74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 13 deletions

View File

@ -21,6 +21,7 @@
["module-resolver", {
"root": ["./src"],
"alias": {
"modules": "./node_modules",
"client": "./src/client",
"server": "./src/server"
}

View File

@ -17,15 +17,13 @@ const { Router } = require('express')
const { env } = require('process')
const { renderToString } = require('react-dom/server')
const root = require('window-or-global')
const { resolve } = require('path')
const { createStore, compose, applyMiddleware } = require('redux')
const thunk = require('redux-thunk').default
const { ServerStyleSheets } = require('@material-ui/core/styles')
const { ChunkExtractor } = require('@loadable/server')
const rootReducer = require('client/store/reducers')
const { getConfig } = require('server/utils/yml')
const {
availableLanguages, defaultWebpackMode, defaultApps, defaultFileStats
availableLanguages, defaultWebpackMode, defaultApps
} = require('server/utils/constants/defaults')
const { APP_URL, STATIC_FILES_URL } = require('client/constants')
const { upperCaseFirst } = require('client/utils')
@ -69,10 +67,6 @@ router.get('*', (req, res) => {
const sheets = new ServerStyleSheets()
const composeEnhancer = (root && root.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose
// loadable
const statsFile = resolve(__dirname, 'client', app + defaultFileStats)
const extractor = new ChunkExtractor({ statsFile })
// SSR redux store
store = createStore(rootReducer, composeEnhancer(applyMiddleware(thunk)))
storeRender = `<script id="preloadState">window.__PRELOADED_STATE__ = ${
@ -80,10 +74,8 @@ router.get('*', (req, res) => {
}</script>`
component = renderToString(
extractor.collectChunks(
sheets.collect(
<App location={req.url} context={context} store={store} />
)
sheets.collect(
<App location={req.url} context={context} store={store} />
)
)

View File

@ -29,7 +29,10 @@ const js = {
}
const css = {
test: /\.css$/i,
use: ['style-loader', 'css-loader']
use: [
'style-loader',
'css-loader'
]
}
/**

View File

@ -29,7 +29,14 @@ const js = {
const css = {
test: /\.css$/i,
use: ['style-loader', 'css-loader']
use: [
{
loader: 'css-loader',
options: {
esModule: false
}
}
]
}
const worker = {