Skip to content

Commit

Permalink
feat: core bundle (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkaraChen authored Dec 18, 2022
1 parent 80e39dd commit e34655d
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 75 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"pnpm": "^7.18.2",
"prettier": "^2.8.1",
"rimraf": "^3.0.2",
"tslib": "^2.4.1",
"typescript": "^4.9.4"
}
}
7 changes: 6 additions & 1 deletion packages/jwc-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "rollup -c rollup.config.mjs"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.0.1",
"csstype": "^3.1.1",
"esbuild": "^0.16.9",
"rollup": "^3.7.4",
"rollup-plugin-esbuild": "^5.0.0",
"rollup-plugin-typescript2": "^0.34.1",
"vite": "^4.0.1"
},
"dependencies": {
"@jwcjs/reactively": "workspace:^1.0.0",
"@jwcjs/runtime": "workspace:^1.0.0",
"reflect-metadata": "^0.1.13"
},
"exports": {
".": "./dist/index.js"
}
}
16 changes: 16 additions & 0 deletions packages/jwc-core/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from "rollup";
import nodeResolve from "@rollup/plugin-node-resolve";
import typescript from "rollup-plugin-typescript2";
import { minify } from "rollup-plugin-esbuild";

export default defineConfig({
input: "./index.ts",
output: {
file: "./dist/index.js",
},
plugins: [
nodeResolve(),
typescript({ exclude: "../jwc-starter-vite-ts/**" }),
minify(),
],
});
4 changes: 2 additions & 2 deletions packages/jwc-runtime/dom/elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export function createElement(node: VNode): Node {
const eventName = key.slice(2).toLowerCase();
el.addEventListener(eventName, attributes[key]);
} else {
// @ts-ignore
node.tagName === "Fragment"
? null
: el.setAttribute(camelToDash(key), attributes[key]);
: // @ts-ignore
el.setAttribute(camelToDash(key), attributes[key]);
}
}

Expand Down
Loading

0 comments on commit e34655d

Please sign in to comment.