Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: welcome back webpack #10482

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ tests/clover*.xml
node_modules/

/js
/css

# packaged app
build/artifacts
Expand Down
8 changes: 0 additions & 8 deletions babel.config.cjs

This file was deleted.

19 changes: 19 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
module.exports = {
plugins: [
'@babel/plugin-syntax-dynamic-import'
],
presets: [
[
'@babel/preset-env',
{
modules: process.env.NODE_ENV === 'testing' ? 'commonjs' : undefined,
useBuiltIns: process.env.NODE_ENV === 'testing' ? 'usage' : 'entry',
corejs: 3
}
]
]
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions jest.config.cjs → jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ module.exports = {
require.resolve('jest-transform-stub'),
'^.+\\.jsx?$': require.resolve('babel-jest'),
},
// support the same @ -> src alias mapping in source code
moduleNameMapper: {
// support the same @ -> src alias mapping in source code
'^@/(.*)$': '<rootDir>/src/$1',
// trim "?raw" suffixes from svg imports
'(.*\\.svg)\\?raw$': '$1',
},
// serializer for snapshots
snapshotSerializers: [
Expand Down
2 changes: 1 addition & 1 deletion krankerl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[package]
before_cmds = [
"composer install --no-dev -o",
"npm install",
"npm install --deps",
"npm run build",
"composer openapi"
]
4 changes: 2 additions & 2 deletions lib/Controller/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ public function getHtmlBody(int $id, bool $plain = false): Response {
$html,
$this->nonceManager->getNonce(),
$this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkTo('mail', 'js/mail-htmlresponse.mjs')
),
$this->urlGenerator->linkTo('mail', 'js/htmlresponse.js')
)
);

// Harden the default security policy
Expand Down
2 changes: 1 addition & 1 deletion lib/Http/HtmlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ public function render(): string {
return $this->content;
}

return '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script nonce="' . $this->nonce . '" src="' . $this->scriptUrl . '" type="module"></script></head><body>' . $this->content . '<div data-iframe-height></div></body></html>';
return '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script nonce="' . $this->nonce . '" src="' . $this->scriptUrl . '"></script></head><body>' . $this->content . '<div data-iframe-height></div></body></html>';
}
}
Loading
Loading