Skip to content

Instantly share code, notes, and snippets.

@mohamedmansour
Last active August 23, 2023 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohamedmansour/9c80e1eef158eba11d1043bee37d2297 to your computer and use it in GitHub Desktop.
Save mohamedmansour/9c80e1eef158eba11d1043bee37d2297 to your computer and use it in GitHub Desktop.
Transitive dependencies do not work with aliased package names
<!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>
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);
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))
})
{
"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/web-components@3.0.0-alpha.30",
"@microsoft/fast-element-v3": "npm:@microsoft/fast-element@2.0.0-beta.26",
"@microsoft/fast-foundation-v3": "npm:@microsoft/fast-foundation@3.0.0-alpha.31",
"@microsoft/fast-web-utilities-v3": "npm:@microsoft/fast-web-utilities@6.0.0"
},
"devDependencies": {
"esbuild": "0.19.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment