How do I correctly config Snowpack to React project?

427 Views Asked by At

I am new to Snowpack and am struggling to get it up and running correctly.

I have a CRA project with the structure:

ROOT
- build
- public
- src
---- components, etc
- snowpack.config.js
- package.json

In my snowpack.config.js I have this:

module.exports = {
  extends: '@snowpack/app-scripts-react',
  mount: {
    public: { url: "/" },
    src: { url: "/_dist_" }
  },
  plugins: [],
  buildOptions: {
    htmlFragments: true,
  },
  installOptions: {
    polyfillNode: true,
  },
}

I'm not sure how I should be configuring the output structure but at the moment I'm getting 404s on the snowpack dev with errors showing the output paths as:

/Users/tom.allen/dev/project/react/public/react/build/static/js/react-app-main.ead55448aefebb009e7b.js

Has anyone had a similar problem before? Or could anyone guide me in the right direction? Any help would be massively appreciated.

0

There are 0 best solutions below