question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LESS output is always bundled into JS

See original GitHub issue

For CSS and SASS in create-react-app

  • development build (npm start), the css is bundled with the js files.
  • production build (npm build) , the css is chunked out into css files.

While using this plugin, the css is always bundled with the js files. Ideally this less plugin functions the same way the sass loader in CRA does, which would include extracting CSS from the js bundle and including it in css files.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
duhseekohcommented, Nov 21, 2018

No problem. Thanks for the package.

I was thinking, one interesting way to solve this particular issue, and to keep it entirely in sync with how the set of loaders supporting sass in official CRA work, is to…

  1. have this plugin find and copy the sass loader section (output of getStyleLoader)
  2. in that copy, just replace the sass-loader for less-loader
  3. push that copy into the list of loaders (before file-loader)
0reactions
duhseekohcommented, Dec 8, 2018

Awesome thanks. Will check it out this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

why webpack output is always main.js? - Stack Overflow
When I run the command npx webpack or npm run build , the output file is always saved as dist/main.js instead of dist/bundle.js....
Read more >
Output Management - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Possible ways to reduce your webpack bundle size - Medium
Webpack is an awesome static bundler for your JavaScript applications but things can get a little messy when the size of your webpack...
Read more >
Less.js: Getting started
You can do this pretty intuitively in Less. Say you want to bundle some mixins and variables under #bundle , for later reuse...
Read more >
3 ways to reduce webpack bundle size - Jakob Lind
Are you using CSS in JavaScript? Then you could extract the CSS to a separate JavaScript bundle or a CSS file. The advantage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found