Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

154
Views
Snowpack 3.8 cannot find the source folder, running dev server with different root directory

I have a project structure like this:

enter image description here

When starting the dev server from root directory everything works perfectly. I would like my index.html file to be in the src directory, but then snowpack does not find the index.html file. When starting the snowpack dev server from inside the src directory it says it can not find the package.json file which is required.

Is there a possibility to start the snowpack dev server from my projects directory, but point to src as the root directory to be served?

I have tried the following configurations in snowpack.config.js

export default {
  root: "./src/index.html",
  mount: {
    src: "/src",
    public: "/",
  },
};
export default {
  mount: {
    public: { url: '/', static: true },
    src: { url: '/src' },
  },
};
export default {
  mount: {
    public: '/',
    src: '/src',
  },
};
7 months ago · Juan Pablo Isaza
1 answers
Answer question

0

If someone swing by having a similar problem, this link might help:

frontend build config generator

The generator created the following snowpack.config:

{
  "mount": {
    "dist": "/",
    "src": "/"
  }
}

After applying this configuration, Snowpack should work as requested.

7 months ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.