Skip to content

Commit

Permalink
Update dependency rollup to ^2.79.0 (#565)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
calebeby and renovate[bot] authored Aug 31, 2022
1 parent f7eb16e commit 9831d71
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 75 deletions.
1 change: 1 addition & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 9831d71

Please sign in to comment.