malash / linaria-issue-878

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linaria rebuild twice issue demo

For more details see callstack/linaria#878

Reproduce steps

  1. Run yarn
  2. Run yarn start
  3. Un-comment/comment the line 9 in src/App.js

from

const Title = styled.h1`
  font-family: sans-serif;
  font-size: 48px;
  color: #f15f79;
  /* font-weight: bold; */
`;

to

const Title = styled.h1`
  font-family: sans-serif;
  font-size: 48px;
  color: #f15f79;
  font-weight: bold;
`;
  1. Watch Webpack's log, the Compiled successfully output twice, which means Webpack rebuild twice.

image

Temporary fix

Un-comment this line in webpack.config.js to fix the issue:

// { loader: require.resolve("./bugfix/replaceRequireRequestLoader") },

About


Languages

Language:JavaScript 88.8%Language:HTML 11.2%