Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

367
Views
¿Cómo usar svelte en un proyecto existente?

Soy nuevo en svelte y estoy tratando de usarlo en mi proyecto existente siguiendo este tutorial. Entonces, en main.js de svelte, genero css y js así:

 export default { input: 'src/main.js', output: { sourcemap: true, format: 'iife', name: 'app', file: '/path/to/myapp/static/js/svelte-bundle.js' }, plugins: [ svelte({ compilerOptions: { // enable run-time checks when not in production dev: !production } }), // we'll extract any component CSS out into // a separate file - better for performance css({ output: '/path/to/myapp/static/css/svelte-bundle.css' }),

Sin embargo, después npm run dev , aparece este error:

 svelte-app@1.0.0 dev rollup -c -w rollup v2.56.3 bundles src/main.js → ../static/js/svelte-bundle.js... [!] (plugin css) Error: The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "/path/to/myapp/static/css/svelte-bundle.css". Error: The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "/path/to/myapp/static/css/svelte-bundle.css". at error (/path/to/myapp/svelte-components/node_modules/rollup/dist/shared/rollup.js:151:30) at FileEmitter.emitFile (/path/to/myapp/svelte-components/node_modules/rollup/dist/shared/rollup.js:13119:24) at Object.generateBundle (/path/to/myapp/svelte-components/node_modules/rollup-plugin-css-only/dist/index.cjs.js:84:12) at /path/to/myapp/svelte-components/node_modules/rollup/dist/shared/rollup.js:20218:25

También agregué los scripts al html de myapp:

 <link href="/static/css/svelte-bundle.css" /> <script defer src="/static/js/svelte-bundle.js"></script>

También en el navegador obtengo:

 http://127.0.0.1:8080/static/svelte-bundle.js net::ERR_ABORTED 404 (Not Found)

Agradezco su ayuda para solucionar esto.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!