mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-06 20:11:38 +08:00
R=alexrudenko@chromium.org Bug: 1011811 Change-Id: Iab2448eeb013c2e1e3a33f10286c826dbd444000 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550701 Commit-Queue: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Auto-Submit: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
30 lines
745 B
JavaScript
30 lines
745 B
JavaScript
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// WARNING: don't use this rollup plugin outside of inspector_overlay.
|
|
// See README for special constraints the overlay has.
|
|
|
|
module.exports = function loadCSS() {
|
|
return {
|
|
name: 'loadCSS',
|
|
/**
|
|
* @param {!Object} code
|
|
* @param {string} id
|
|
*/
|
|
transform(code, id) {
|
|
if (id.endsWith('.css')) {
|
|
return {
|
|
code: `
|
|
const style = new CSSStyleSheet();
|
|
style.replaceSync(${JSON.stringify(code)});
|
|
export default style;
|
|
`,
|
|
map: null
|
|
};
|
|
}
|
|
return;
|
|
}
|
|
};
|
|
};
|