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

Use generateBundle instead of onwrite #148

Merged
merged 5 commits into from Jan 22, 2019
Merged

Use generateBundle instead of onwrite #148

merged 5 commits into from Jan 22, 2019

Conversation

sampi
Copy link
Contributor

@sampi sampi commented Jan 9, 2019

@egoist @lmihaidaniel

Fixes #147

The onwrite rollup hook has been deprecated in favor of generateBundle in rollup@1.x.x. rollup/rollup#2409

Fixes #147

The `onwrite` rollup hook has been deprecated in favor of `generateBundle`. rollup/rollup#2409
@nathancahill
Copy link

Can you update the snapshots in the tests?

@sampi
Copy link
Contributor Author

sampi commented Jan 11, 2019

@nathancahill hey, I did but something doesn't look ok, and the order of the css rules aren't deterministic. (no matter if I update the snapshots or not, it fails)

I'll have to investigate a bit more.

@kendrickw
Copy link
Contributor

PR #143 should fix the order of css rules, and make the order deterministics.

However, with the new generateBundle, the code:

        const entries = Array.from(extracted.values())
        if (bundle.modules) {
          const fileList = Object.keys(bundle.modules)
          entries.sort((a, b) => (
            fileList.indexOf(a.id) - fileList.indexOf(b.id)
          ))
        }

should become:

        const entries = Array.from(extracted.values())
        const { modules } = bundle[path.basename(opts.file)]
        if (modules) {
          const fileList = Object.keys(modules)
          entries.sort((a, b) => (
            fileList.indexOf(a.id) - fileList.indexOf(b.id)
          ))
        }

@codecov
Copy link

codecov bot commented Jan 22, 2019

Codecov Report

Merging #148 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #148      +/-   ##
==========================================
+ Coverage   94.61%   94.69%   +0.07%     
==========================================
  Files           8        8              
  Lines         223      226       +3     
  Branches       77       79       +2     
==========================================
+ Hits          211      214       +3     
  Misses         12       12
Impacted Files Coverage Δ
src/index.js 98.33% <100%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b756821...879ffe6. Read the comment docs.

@egoist egoist merged commit 59fb0e9 into egoist:master Jan 22, 2019
@egoist
Copy link
Owner

egoist commented Jan 22, 2019

Thanks @kendrickw I fixed the module order in the PR.

@sampi sampi deleted the rollup-1.x.x branch February 18, 2019 10:52
bung87 pushed a commit to bung87/rollup-plugin-postcss that referenced this pull request Dec 3, 2019
@egoist @lmihaidaniel 

Fixes egoist#147

The `onwrite` rollup hook has been deprecated in favor of `generateBundle` in `rollup@1.x.x`. rollup/rollup#2409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants