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

Update dependency rollup to ^2.79.0 #565

Merged
merged 4 commits into from Aug 31, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions jest.config.cjs
Expand Up @@ -20,4 +20,5 @@ module.exports = {
// it must be transpiled to CJS
transformIgnorePatterns: ['<rootDir>/node_modules/(?!ansi-regex)'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testTimeout: 10_000,
};
149 changes: 106 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -84,7 +84,7 @@
"mime": "^3.0.0",
"postcss": "^8.4.16",
"puppeteer": "^16.2.0",
"rollup": "^2.77.2",
"rollup": "^2.79.0",
"rollup-plugin-postcss": "^4.0.2",
"source-map": "0.8.0-beta.0"
},
Expand Down
6 changes: 5 additions & 1 deletion src/module-server/middleware/css.ts
Expand Up @@ -56,7 +56,11 @@ export const cssMiddleware = ({
},
};
// We need to call the transform hook, but get the CSS out of it before it converts it to JS
const result = await cssPlug.transform.call(
const cssTransform =
'handler' in cssPlug.transform
? cssPlug.transform.handler
: cssPlug.transform;
const result = await cssTransform.call(
ctx as TransformPluginContext,
code,
id,
Expand Down
5 changes: 4 additions & 1 deletion src/module-server/plugins/css.ts
Expand Up @@ -52,7 +52,10 @@ export const cssPlugin = ({
});
// Adds .meta.css to returned object (for use in CSS middleware)
if (returnCSS) {
const originalTranform = plugin.transform!;
const originalTranform =
'handler' in plugin.transform!
? plugin.transform.handler
: plugin.transform!;
plugin.transform = async function (code, id) {
let result = await originalTranform.call(this, code, id);
if (typeof result === 'string') result = { code: result, map: '' };
Expand Down