Fix mozilla linter problems

This commit is contained in:
Kuba Orlik 2022-07-09 16:41:22 +02:00
parent 256d44613f
commit 8a93cf5463
3 changed files with 12 additions and 4 deletions

View File

@ -31,6 +31,7 @@
<div id="app"></div> <div id="app"></div>
<script src="/node_modules/react/umd/react.development.js"></script> <script src="/node_modules/react/umd/react.development.js"></script>
<script src="/node_modules/react-dom/umd/react-dom.development.js"></script> <script src="/node_modules/react-dom/umd/react-dom.development.js"></script>
<script src="/node_modules/survey-react/survey.react.min.js"></script>
<script src="/lib/components/report-window/report-window.js"></script> <script src="/lib/components/report-window/report-window.js"></script>
</body> </body>

View File

@ -12,7 +12,7 @@ const watch = process.argv.includes('--watch') && {
let skipReactImports = { let skipReactImports = {
name: 'skipReactImports', name: 'skipReactImports',
setup(build) { setup(build) {
build.onResolve({ filter: /^react(-dom)?$/ }, (args) => { build.onResolve({ filter: /^(react(-dom)?|survey-react)$/ }, (args) => {
return { return {
path: args.path, path: args.path,
namespace: `globalExternal_${args.path}`, namespace: `globalExternal_${args.path}`,
@ -32,6 +32,12 @@ let skipReactImports = {
loader: 'js', loader: 'js',
}; };
}); });
build.onLoad({ filter: /.*/, namespace: 'globalExternal_survey-react' }, () => {
return {
contents: `module.exports = globalThis.Survey`,
loader: 'js',
};
});
}, },
}; };
@ -54,7 +60,7 @@ esbuild
PLUGIN_NAME: '"Rentgen"', PLUGIN_NAME: '"Rentgen"',
PLUGIN_URL: '"https://git.internet-czas-dzialac.pl/icd/rentgen"', PLUGIN_URL: '"https://git.internet-czas-dzialac.pl/icd/rentgen"',
}, },
external: ['react', 'react-dom'], external: ['react', 'react-dom', 'survey-react'],
watch, watch,
}) })
.then(() => console.log('Add-on was built')) .then(() => console.log('Add-on was built'))

View File

@ -9,7 +9,8 @@
"watch": "node esbuild.config.js --watch", "watch": "node esbuild.config.js --watch",
"ext-test": "web-ext run", "ext-test": "web-ext run",
"create-package": "web-ext build", "create-package": "web-ext build",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit",
"lint": "web-ext lint"
}, },
"repository": { "repository": {
"type": "git", "type": "git",