Meteor-Community-Packages / Meteor-Community-Packages/meteor-postcss

import less from a JavaScript file in imports folder not being processed by postcss

Open
#37 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
66
Forks
22
PR merge metrics
No merged PRs in 30d

Description

import less from a JavaScript file in imports folder, that less is not bundled with the rest of the CSS processed with the Meteor Build tool, but instead is put in your app’s tag inside ... after the main concatenated CSS file. like this.
```
/imports/components/
/componentA/
componentA.jsx
componentA.less
```
```
componentA.jsx
import React from 'react';
import './componentA.less';
export const ComponentA = (props) => {

return (


whoopee!



);
}
```
componentA.less is not being processed by postcss.

```
import componentA.less in /client/main.less
@import '{}/imports/ui/componentA.less';
```
it work processed by postcss! but componentA.less being processed and merge by meteor in one big css file, can't be dynamic import optimize.
so how import less from a JavaScript file in imports folder being processed by postcss

Contributor guide

Open the contributing guide

Research direction

The report provides a reproduction using imports/components/componentA/componentA.jsx, componentA.less, and client/main.less; begin by comparing the JavaScript import with the main.less import in a minimal Meteor app. Trace the repository's PostCSS handling for imported Less and consider the issue resolved when the JavaScript-imported stylesheet is processed without requiring client/main.less.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.