Skip to content

Commit

Permalink
feat(cli): add webpack config for JS and CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
mediremi authored and KaiVandivier committed Aug 23, 2022
1 parent cec6339 commit a04b7c6
Show file tree
Hide file tree
Showing 8 changed files with 1,018 additions and 479 deletions.
3 changes: 3 additions & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"archiver": "^3.1.1",
"axios": "^0.25.0",
"babel-jest": "^27.0.6",
"babel-loader": "^8.1.0",
"babel-plugin-react-require": "^3.1.3",
"chokidar": "^3.3.0",
"detect-port": "^1.3.0",
Expand All @@ -49,9 +50,11 @@
"i18next-scanner": "^2.10.3",
"inquirer": "^7.3.3",
"lodash": "^4.17.11",
"mini-css-extract-plugin": "^2.5.3",
"node-http-proxy-json": "^0.1.9",
"parse-author": "^2.0.0",
"parse-gitignore": "^1.0.1",
"react-dev-utils": "^12.0.0",
"styled-jsx": "^4.0.1",
"webpack": "^5.41.1",
"workbox-build": "^6.1.5"
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = (cwd = process.cwd()) => {
shellApp: path.join(base, `./.d2/shell/${shellAppDirname}`),
shellPluginBundleEntrypoint: path.join(
base,
'./.d2/shell/src/plugin.js'
'./.d2/shell/src/plugin.index.js'
),
shellPluginEntrypoint: path.join(base, './.d2/shell/src/Plugin.js'),
shellSrcServiceWorker: path.join(
Expand Down
10 changes: 5 additions & 5 deletions cli/src/lib/plugin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ module.exports = async ({ paths }) => {
return
}

if (stats.hasWarnings()) {
console.warn(info.warnings)
reject(new Error(info.warnings))
return
}
/*if (stats.hasWarnings()) {
console.warn(
info.warnings.map(warning => warning.message).join('\n')
)
}*/

resolve()
})
Expand Down
1 change: 1 addition & 0 deletions cli/src/lib/plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const start = require('./start')

module.exports = ({ config, paths }) => ({
// build: () => build({ config, paths }),
// XXX
build: async () => {
try {
await build({ config, paths })
Expand Down
576 changes: 576 additions & 0 deletions cli/src/lib/plugin/old.webpack.config.js

Large diffs are not rendered by default.

489 changes: 43 additions & 446 deletions cli/src/lib/plugin/webpack.config.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion shell/src/plugin.js → shell/src/plugin.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import ReactDOM from 'react-dom'
import Plugin from './Plugin'
import 'typeface-roboto'
import './index.css'
// import './index.css'

ReactDOM.render(
<>
Expand Down
414 changes: 388 additions & 26 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit a04b7c6

Please sign in to comment.