Skip to content

Commit

Permalink
Upgrade esbuild a lot
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Mar 12, 2024
1 parent d7bbbef commit 91233e0
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 208 deletions.
2 changes: 1 addition & 1 deletion django_prose_editor/static/django_prose_editor/editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions django_prose_editor/static/django_prose_editor/editor.js

Large diffs are not rendered by default.

35 changes: 0 additions & 35 deletions esbuild.js

This file was deleted.

28 changes: 28 additions & 0 deletions esbuild.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as esbuild from "esbuild"
import postcss from "esbuild-postcss"

let devMode = process.argv.includes("watch")
let ctx = await esbuild.context({
entryPoints: ["./src/index.js"],
jsxFactory: "h",
jsxFragment: "Fragment",
loader: {
".js": "jsx",
".svg": "file",
},
minify: true,
bundle: true,
target: "es6",
format: "iife",
globalName: "DjangoProseEditor",
plugins: [postcss()],
outfile: "django_prose_editor/static/django_prose_editor/editor.js",
sourcemap: devMode,
})

if (devMode) {
await ctx.watch()
} else {
await ctx.rebuild()
ctx.dispose()
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"license": "MIT",
"dependencies": {
"autoprefixer": "^10.4.7",
"esbuild": "^0.14.42",
"esbuild": "^0.20.1",
"esbuild-postcss": "^0.0.4",
"lodash-es": "^4.17.21",
"postcss": "^8.4.14",
"postcss-nested": "^5.0.6",
"prosemirror-commands": "^1.5.2",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-gapcursor": "^1.3.2",
Expand All @@ -25,7 +24,7 @@
"prosemirror-view": "^1.31.4"
},
"scripts": {
"dev": "node esbuild.js watch",
"prod": "node esbuild.js"
"dev": "node esbuild.mjs watch",
"prod": "node esbuild.mjs"
}
}
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
plugins: [require("postcss-nested")(), require("autoprefixer")()],
plugins: [require("autoprefixer")()],
}
Loading

0 comments on commit 91233e0

Please sign in to comment.