Skip to content

Commit 85de9aa

Browse files
committed
build: use poi to build files, so we can handle css in js now πŸ™Œ
1 parent 8c663d2 commit 85de9aa

File tree

11 files changed

+4609
-224
lines changed

11 files changed

+4609
-224
lines changed

β€Žlib/material.min.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

β€Žlib/material.min.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

β€Žpackage.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"version": "0.9.3",
55
"description": "Regular Developer Tools is a Chrome Extension that allows real-time inspection of [Regular](http://regularjs.github.io/) components.",
66
"scripts": {
7-
"build": "npm run devtool-build && npm run inject-build",
8-
"devtool-build": "bili src/devtools/devtools.js --out-dir dist --name devtools.bundle --format umd --exports none",
9-
"inject-build": "bili src/frontend/inject.js --out-dir dist --name inject.bundle --format umd --exports none",
10-
"watch": "concurrently \"npm run devtool-watch\" \"npm run inject-watch\"",
11-
"devtool-watch": "npm run devtool-build -- --watch",
12-
"inject-watch": "npm run inject-build -- --watch",
7+
"build": "npm run build:devtools && npm run build:inject",
8+
"build:devtools": "poi build --config scripts/devtools.config.js",
9+
"build:inject": "poi build --config scripts/devtools.config.js",
10+
"watch": "concurrently \"npm run watch:devtools\" \"npm run watch:inject\"",
11+
"watch:devtools": "poi watch --config scripts/devtools.config.js",
12+
"watch:inject": "poi watch --config scripts/inject.config.js",
1313
"test": "npm run lint",
1414
"lint": "eslint src --quiet",
1515
"precommit": "lint-staged"
@@ -34,7 +34,9 @@
3434
"eslint-config-google": "^0.6.0",
3535
"husky": "^0.14.3",
3636
"lint-staged": "^4.1.3",
37+
"material-design-lite": "^1.3.0",
3738
"mitt": "^1.1.2",
39+
"poi": "^9.3.5",
3840
"regularjs": "0.5.2"
3941
},
4042
"dependencies": {}

β€Žscripts/devtools.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
entry: './src/devtools/devtools.js',
3+
filename: {
4+
js: 'devtools.[name].js'
5+
},
6+
webpack( config ) {
7+
config.output.publicPath = '/dist/';
8+
config.resolve.alias[ 'regularjs' ] = require.resolve( 'regularjs/dist/regular.js' );
9+
return config;
10+
},
11+
minimize: true,
12+
sourceMap: true,
13+
extractCSS: true,
14+
vendor: true
15+
};

β€Žscripts/inject.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
entry: './src/frontend/inject.js',
3+
filename: {
4+
js: 'inject.bundle.js'
5+
},
6+
minimize: true,
7+
sourceMap: true,
8+
html: false,
9+
vendor: false
10+
};

β€Žsrc/devtools/devtools.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@font-face {
22
font-family: "Roboto";
3-
src:url("../../lib/Roboto-Regular.ttf");
3+
src:url("./fonts/Roboto-Regular.ttf");
44
}
55

66
html {
@@ -13,7 +13,7 @@ body {
1313
font-family: Consolas, Lucida Console, Menlo, monospace, '.SFNSDisplay-Regular', 'Helvetica Neue', 'Lucida Grande', sans-serif;
1414
}
1515

16-
.devtools {
16+
#app {
1717
box-sizing: border-box;
1818
padding-top: 60px;
1919
width: 100%;

β€Žsrc/devtools/devtools.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// the real devtools script
22
// the UI layer of devtools
33
import Regular from "regularjs";
4+
import 'material-design-lite';
45
import CircularJSON from "../shared/circular-json";
56
import log from '../shared/log';
67
import {enter, input, mouseenter, mouseleave} from './events';
@@ -17,10 +18,11 @@ import {
1718
syncArr
1819
} from './utils';
1920
import agent from './agent';
20-
21-
// components
2221
import DevtoolsViewComponent from './components/DevtoolsView';
2322

23+
import 'material-design-lite/dist/material.min.css';
24+
import './devtools.css';
25+
2426
// register custom events
2527
Regular.use(enter);
2628
Regular.use(input);

β€Žsrc/devtools/entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// create new panel for devtools
22
chrome.devtools.panels.create("Regular",
3-
"./assets/regular.png",
4-
"./src/devtools/panel.html",
3+
"/assets/regular.png",
4+
"/dist/index.html",
55
function(panel) {
66
panel.onShown.addListener(function(extPanelWindow) {
77
chrome.devtools.inspectedWindow.eval(
File renamed without changes.

β€Žsrc/devtools/panel.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
Β (0)