Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gem doesn't work with webpack-assets-manifest #39

Open
Szeliga opened this issue Dec 5, 2020 · 1 comment · May be fixed by #40 or #42
Open

Gem doesn't work with webpack-assets-manifest #39

Szeliga opened this issue Dec 5, 2020 · 1 comment · May be fixed by #40 or #42

Comments

@Szeliga
Copy link

Szeliga commented Dec 5, 2020

The webpack plugin suggested in the readme creates a different structure than minipack expects.

What is being generated

{
  "entrypoints": {
    "main": {
      "assets": {
        "js": [
          "static/js/bundle.js",
          "static/js/0.chunk.js",
          "static/js/main.chunk.js"
        ],
        "js.map": [
          "static/js/bundle.js.map",
          "static/js/0.chunk.js.map",
          "static/js/main.chunk.js.map"
        ]
      }
    }
  },
  "main.js": "static/js/main.chunk.js",
  "main.js.map": "static/js/main.chunk.js.map",
  "runtime-main.js": "static/js/bundle.js",
  "runtime-main.js.map": "static/js/bundle.js.map",
  "static/js/0.chunk.js": "static/js/0.chunk.js",
  "static/js/0.chunk.js.map": "static/js/0.chunk.js.map",
  "static/js/1.chunk.js": "static/js/1.chunk.js",
  "static/js/1.chunk.js.map": "static/js/1.chunk.js.map",
  "static/media/logo.svg": "static/media/logo.6ce24c58.svg"
}

What minipack expects:

{
  "entrypoints": {
    "main": {
      "js": [
        "static/js/bundle.js",
        "static/js/0.chunk.js",
        "static/js/main.chunk.js"
      ],
      "js.map": [
        "static/js/bundle.js.map",
      "static/js/0.chunk.js.map",
      "static/js/main.chunk.js.map"
      ]
    }
  },
  "main.js": "static/js/main.chunk.js",
  "main.js.map": "static/js/main.chunk.js.map",
  "runtime-main.js": "static/js/bundle.js",
  "runtime-main.js.map": "static/js/bundle.js.map",
  "static/js/0.chunk.js": "static/js/0.chunk.js",
  "static/js/0.chunk.js.map": "static/js/0.chunk.js.map",
  "static/js/1.chunk.js": "static/js/1.chunk.js",
  "static/js/1.chunk.js.map": "static/js/1.chunk.js.map",
  "static/media/logo.svg": "static/media/logo.6ce24c58.svg"
}

The plugin nests entries in an additional assets key which isn't where the Manifest class looks - https://github.com/nikushi/minipack/blob/master/lib/minipack/manifest.rb#L53-L57

Szeliga added a commit to Szeliga/minipack that referenced this issue Dec 5, 2020
Fixes nikushi#39
It allows to define a custom path for pack lookup
@Szeliga Szeliga linked a pull request Dec 5, 2020 that will close this issue
@Szeliga
Copy link
Author

Szeliga commented Dec 5, 2020

I've prepared a pull request that proposes a way to solve this.

@aeaston aeaston linked a pull request Mar 2, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant