我正在尝试使用 svelte 使用它的模板(https://github.com/sveltejs/template/)作为起点。
\n我想使用https://github.com/nimiq/qr-scanner扫描二维码,但在我的电脑上,我没有网络摄像头,而且我的手机不想启动 qrScanner,因为该页面不是\ 不通过 https 提供服务。
\n当我跑步时npm run dev我得到:
Your application is ready~! \n\n - Local: http://0.0.0.0:5000\n - Network: http://192.168.1.13:5000\n\n\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80 LOGS \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\nRun Code Online (Sandbox Code Playgroud)\n我的 rollup.config.js:
\n Your application is ready~! \n\n - Local: http://0.0.0.0:5000\n - Network: http://192.168.1.13:5000\n\n\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80 LOGS \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\nRun Code Online (Sandbox Code Playgroud)\n和包 json:
\nimport svelte from "rollup-plugin-svelte";\nimport resolve from "@rollup/plugin-node-resolve";\nimport commonjs from "@rollup/plugin-commonjs";\nimport livereload from "rollup-plugin-livereload";\nimport { terser } from "rollup-plugin-terser";\nimport { string } from "rollup-plugin-string";\n\nconst production = !process.env.ROLLUP_WATCH;\n\nfunction serve() {\n let server;\n\n function toExit() {\n if (server) server.kill(0);\n }\n\n return {\n writeBundle() {\n if (server) return;\n server = require("child_process").spawn(\n "npm",\n ["run", "start", "--", "--dev"],\n {\n stdio: ["ignore", "inherit", "inherit"],\n shell: true,\n }\n );\n\n process.on("SIGTERM", toExit);\n process.on("exit", toExit);\n },\n };\n}\n\nexport default {\n input: "src/main.js",\n output: {\n sourcemap: true,\n format: "iife",\n name: "app",\n file: "public/build/bundle.js",\n },\n plugins: [\n svelte({\n // enable run-time checks when not in production\n dev: !production,\n // we\'ll extract any component CSS out into\n // a separate file - better for performance\n css: (css) => {\n css.write("public/build/bundle.css");\n },\n }),\n string({\n include: "node_modules/qr-scanner/qr-scanner-worker.min.js",\n }),\n\n // If you have external dependencies installed from\n // npm, you\'ll most likely need these plugins. In\n // some cases you\'ll need additional configuration -\n // consult the documentation for details:\n // https://github.com/rollup/plugins/tree/master/packages/commonjs\n resolve({\n browser: true,\n dedupe: ["svelte"],\n }),\n commonjs(),\n\n // In dev mode, call `npm run start` once\n // the bundle has been generated\n !production && serve(),\n\n // Watch the `public` directory and refresh the\n // browser on changes when not in production\n !production && livereload("public"),\n\n // If we\'re building for production (npm run build\n // instead of npm run dev), minify\n production && terser(),\n ],\n watch: {\n clearScreen: false,\n },\n};\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
2568 次 |
| 最近记录: |