Skip to content

Commit

Permalink
Merge pull request #106 from CodinGame/webpack-loader-windows
Browse files Browse the repository at this point in the history
Fix webpack-loader on Windows
  • Loading branch information
CGNonofr authored Apr 22, 2023
2 parents 6a7bdc8 + 2c8b376 commit f94aaa3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/override/vs/editor/contrib/suggest/browser/suggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It's treeshaked out of monaco editor and needs to be reintroduced.
If you're using webpack, you can add a loader that will polyfill it:
\`\`\`
{
test: /node_modules\\/monaco-editor\\//,
test: /node_modules[\\/]monaco-editor/,
loader: 'vscode/webpack-loader'
}
\`\`\`
Expand Down
3 changes: 2 additions & 1 deletion src/webpack-loader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { RawLoaderDefinitionFunction } from 'webpack'
import { sep as s } from 'path'

const monacoPolyfillLoader: RawLoaderDefinitionFunction = function (source) {
if (this.resourcePath.endsWith('monaco-editor/esm/vs/editor/contrib/suggest/browser/suggest.js')) {
if (this.resourcePath.endsWith(`monaco-editor${s}esm${s}vs${s}editor${s}contrib${s}suggest${s}browser${s}suggest.js`)) {
return `${source.toString()}
export function setSnippetSuggestSupport(support) {
const old = _snippetSuggestSupport;
Expand Down

0 comments on commit f94aaa3

Please sign in to comment.