Skip to content

Commit

Permalink
Add custom fast-elements structure
Browse files Browse the repository at this point in the history
  • Loading branch information
radium-v committed May 5, 2020
1 parent c3175bf commit 82e3742
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions sites/fast-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"license": "MIT",
"devDependencies": {
"@microsoft/fast-components": "^0.10.1",
"@microsoft/fast-element": "^0.8.1",
"babel-core": "^6.26.3",
"babel-loader": "^8.1.0",
"babel-preset-env": "^1.7.0",
Expand Down
10 changes: 10 additions & 0 deletions sites/fast-website/src/app/components/gradient-picker/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { attr, customElement, FASTElement } from "@microsoft/fast-element";

@customElement("gradient-picker")
export class GradientPicker extends FASTElement {
@attr greeting: string = "Hello";

greetingChanged() {
this.shadowRoot!.innerHTML = this.greeting;
}
}
1 change: 1 addition & 0 deletions sites/fast-website/src/app/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { GradientPicker } from "./gradient-picker";
1 change: 1 addition & 0 deletions sites/fast-website/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from "./components";
export * from "@microsoft/fast-components";
1 change: 1 addition & 0 deletions sites/fast-website/src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<fast-design-system-provider use-defaults>
<fast-button>Hello, World!</fast-button>
<gradient-picker>stub</gradient-picker>
</fast-design-system-provider>
</body>
</html>
1 change: 1 addition & 0 deletions sites/fast-website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"strictNullChecks": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"resolveJsonModule": true
},
"include": [
Expand Down
3 changes: 3 additions & 0 deletions sites/fast-website/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ module.exports = {
entry: {
main: path.resolve(appDir, "index.ts"),
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
output: {
path: path.resolve(__dirname, "/dist"),
filename: "bundle.js", // Name of generated bundle after build
Expand Down

0 comments on commit 82e3742

Please sign in to comment.