Skip to content

Commit

Permalink
fix: mf-5989 could not load 'js/trusted-types.js' (#11293)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill committed Jan 17, 2024
1 parent d989f14 commit b9bc9ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/mask/.webpack/config.ts
Expand Up @@ -42,7 +42,7 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
const polyfillFolder = join(nonWebpackJSFiles, './polyfill')

const pnpmPatches = readdir(patchesDir).then((files) => files.map((x) => join(patchesDir, x)))
const baseConfig: webpack.Configuration = {
const baseConfig = {
name: 'mask',
// to set a correct base path for source map
context: join(__dirname, '../../../'),
Expand Down Expand Up @@ -342,7 +342,7 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
client: flags.hmr ? undefined : false,
} as DevServerConfiguration,
stats: flags.mode === 'production' ? 'errors-only' : undefined,
}
} satisfies webpack.Configuration

const entries: Record<string, EntryDescription> = (baseConfig.entry = {
dashboard: withReactDevTools(join(__dirname, '../dashboard/initialization/index.ts')),
Expand All @@ -351,7 +351,7 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
background: normalizeEntryDescription(join(__dirname, '../background/initialization/mv2-entry.ts')),
backgroundWorker: normalizeEntryDescription(join(__dirname, '../background/initialization/mv3-entry.ts')),
})
baseConfig.plugins!.push(
baseConfig.plugins.push(
await addHTMLEntry({ chunks: ['dashboard'], filename: 'dashboard.html', perf: flags.profiling }),
await addHTMLEntry({ chunks: ['popups'], filename: 'popups.html', perf: flags.profiling }),
await addHTMLEntry({
Expand All @@ -363,7 +363,7 @@ export async function createConfiguration(_inputFlags: BuildFlags): Promise<webp
)
if (flags.devtools) {
entries.devtools = normalizeEntryDescription(join(__dirname, '../devtools/panels/index.tsx'))
baseConfig.plugins!.push(
baseConfig.plugins.push(
await addHTMLEntry({ chunks: ['devtools'], filename: 'devtools-background.html', perf: flags.profiling }),
)
}
Expand Down
1 change: 0 additions & 1 deletion packages/mask/.webpack/popups.html
Expand Up @@ -15,7 +15,6 @@
<script src="/js/sentry-patch.js"></script>
<script src="/js/polyfill/lockdown.js"></script>
<script src="/js/lockdown.js"></script>
<script src="/js/trusted-types.js"></script>
<script src="/js/module-loader.js"></script>
<style>
body {
Expand Down
1 change: 0 additions & 1 deletion packages/mask/.webpack/template.html
Expand Up @@ -15,7 +15,6 @@
<script src="/js/sentry-patch.js"></script>
<script src="/js/polyfill/lockdown.js"></script>
<script src="/js/lockdown.js"></script>
<script src="/js/trusted-types.js"></script>
<script src="/js/module-loader.js"></script>
</head>
<body></body>
Expand Down

0 comments on commit b9bc9ad

Please sign in to comment.