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

Asset subbundle builds #625

Merged
merged 5 commits into from
Dec 15, 2020
Merged

Asset subbundle builds #625

merged 5 commits into from
Dec 15, 2020

Conversation

guybedford
Copy link
Contributor

@guybedford guybedford commented Dec 15, 2020

This adds support for building emitted assets, by initiating a sub-build using the same configuration as the main build, while deduping emitted assets against the single shared asset list.

Depends on vercel/webpack-asset-relocator-loader#100 which is yet to be released, but references that from the GitHub master dependencies reference for now.

Two test cases are included one with a require and one with the typescript piscina example.

If asset builds are not wanted, a noAssetBuilds option and a --no-asset-builds flag are also provided.

package.json Outdated Show resolved Hide resolved
@styfle styfle added the automerge Automatically merge PR once checks pass label Dec 15, 2020
@styfle
Copy link
Member

styfle commented Dec 15, 2020

@guybedford Looks like the tests are failing

  ● should generate correct output for bundle-subasset

    ENOENT: no such file or directory, open '/home/runner/work/ncc/ncc/test/unit/bundle-subasset/output-coverage.js'

      10 |     const testDir = `${__dirname}/unit/${unitTest}`;
      11 |     const expected = fs
    > 12 |       .readFileSync(`${testDir}/output${coverage ? '-coverage' : ''}.js`)
         |        ^
      13 |       .toString()
      14 |       .trim()
      15 |       // Windows support

      at Object.readFileSync (test/index.test.js:12:8)

  ● should generate correct output for bundle-subasset2

    ENOENT: no such file or directory, open '/home/runner/work/ncc/ncc/test/unit/bundle-subasset2/output-coverage.js'

      10 |     const testDir = `${__dirname}/unit/${unitTest}`;
      11 |     const expected = fs
    > 12 |       .readFileSync(`${testDir}/output${coverage ? '-coverage' : ''}.js`)
         |        ^
      13 |       .toString()
      14 |       .trim()
      15 |       // Windows support

@guybedford
Copy link
Contributor Author

I've added the coverage unit test, so this should be passing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants