This repository was archived by the owner on Sep 21, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +35
-8
lines changed
packages/devtools-components Expand file tree Collapse file tree 3 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " devtools-components" ,
3- "version" : " 0.4.0 " ,
3+ "version" : " 0.4.1 " ,
44 "description" : " DevTools HTML Components" ,
55 "main" : " index.js" ,
66 "scripts" : {
77 "copy-assets" : " node bin/copy-assets" ,
88 "license-check" : " devtools-license-check" ,
9- "storybook" : " start-storybook -p 9002 -c .storybook -s ./src" ,
9+ "storybook" : " NODE_ENV=storybook start-storybook -p 9002 -c .storybook -s ./src" ,
1010 "test" : " jest"
1111 },
1212 "author" : " Jason Laster" ,
Original file line number Diff line number Diff line change 22 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44
5- // Dumb export so launchpad does not throw.
6- module . exports = ( ) => ( { } ) ;
5+ const mapUrl = require ( "postcss-url-mapper" ) ;
6+ const MC_PATH = "chrome://devtools/skin/images/devtools-components/" ;
7+ const EXPRESS_PATH = "/devtools-components/images/" ;
8+
9+ function mapUrlProduction ( url , type ) {
10+ return url . replace ( "/images/arrow.svg" , MC_PATH + "arrow.svg" ) ;
11+ }
12+
13+ function mapUrlDevelopment ( url ) {
14+ return url . replace ( "/images/arrow.svg" , EXPRESS_PATH + "arrow.svg" ) ;
15+ }
16+
17+ module . exports = ( { file, options, env } ) => {
18+ // Here we don't want to do anything for storybook since we serve the images thanks
19+ // to the `-s ./src` option in the `storybook` command (see package.json).
20+ if ( env === "storybook" ) {
21+ return { } ;
22+ }
23+
24+ // This will be used when creating a bundle for mozilla-central (from devtools-reps
25+ // or debugger.html).
26+ if ( env === "production" ) {
27+ return {
28+ plugins : [ mapUrl ( mapUrlProduction ) ]
29+ } ;
30+ }
31+
32+ // This will be used when using this module in launchpad mode. We set a unique path so
33+ // we can serve images from express.
34+ return {
35+ plugins : [ mapUrl ( mapUrlDevelopment ) ]
36+ } ;
37+ } ;
Original file line number Diff line number Diff line change 2222 user-select : none;
2323}
2424
25- .tree button {
26- display : block;
27- }
28-
2925.tree .tree-node {
3026 display : flex;
3127}
You can’t perform that action at this time.
0 commit comments