Last active
August 23, 2023 21:57
-
-
Save mohamedmansour/9c80e1eef158eba11d1043bee37d2297 to your computer and use it in GitHub Desktop.
Transitive dependencies do not work with aliased package names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Aliased</title> | |
</head> | |
<body> | |
<example-app></example-app> | |
<script type="module" src="./dist/app.js"></script> | |
</body> | |
</html> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { customElement, html, FASTElement } from '@microsoft/fast-element-v3'; | |
import { DesignToken } from '@microsoft/fast-foundation-v3/design-token.js'; | |
import { setTheme } from '@fluentui/web-components-v3'; | |
import { webLightTheme } from '@fluentui/tokens'; | |
import "@fluentui/web-components-v3/button.js"; | |
@customElement({ | |
name: 'example-app', | |
template: html` | |
<div> | |
<fluent-button>Fluent Button</fluent-button> | |
</div>` | |
}) | |
export class ExampleApp extends FASTElement {} | |
DesignToken.registerDefaultStyleTarget(); | |
setTheme(webLightTheme); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('node:path') | |
const fs = require('node:fs') | |
const esbuild = require('esbuild') | |
const distPath = path.join(__dirname, 'dist') | |
esbuild.build({ | |
bundle: true, | |
outdir: distPath, | |
entryPoints: [path.join(__dirname, 'app.ts')], | |
format: 'esm', | |
minify: true, | |
target: 'esnext', | |
sourcemap: true, | |
tsconfigRaw: { | |
compilerOptions: { | |
module: 'esnext', | |
target: 'esnext', | |
experimentalDecorators: true, | |
strict: true, | |
useDefineForClassFields: false | |
} | |
}, | |
metafile: true | |
}).then(results => { | |
fs.mkdirSync(distPath, { recursive: true }) | |
fs.writeFileSync(path.join(distPath, 'meta.json'), JSON.stringify(results.metafile, null, 2)) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "example_app", | |
"version": "1.0.0", | |
"description": "Example App", | |
"type": "module", | |
"scripts": { | |
"start": "node build.cjs" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"@fluentui/tokens": "1.0.0-alpha.2", | |
"@fluentui/web-components-v3": "npm:@fluentui/[email protected]", | |
"@microsoft/fast-element-v3": "npm:@microsoft/[email protected]", | |
"@microsoft/fast-foundation-v3": "npm:@microsoft/[email protected]", | |
"@microsoft/fast-web-utilities-v3": "npm:@microsoft/[email protected]" | |
}, | |
"devDependencies": { | |
"esbuild": "0.19.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment