Comments (4)
Wow, thanks for the tip @jjuutila!
It seems like this mostly works because the CSS parser is able to handle most SCSS syntax. But those inline comments break it (specifically, for us it was a single quote in a //
comment, causing a CssSyntaxError
). To correctly support SCSS, it looks like you need to configure a preprocessor:
// ./path/to/module-exporting-a-function.js
var sass = require('node-sass');
var path = require('path');
module.exports = function processSass(data, filename) {
var result;
result = sass.renderSync({
data: data,
file: filename
}).css;
return result.toString('utf8');
};
What a footgun! #104 seems relevant.
from babel-plugin-css-modules-transform.
Not sure if this is the same problem as you have, but I had this problem when I turned on --inspect
in Node.js and had a debugger window open. The Node application wouldn't end properly reporting Waiting for the debugger to disconnect...
.
The extractCss
output wasn't generated as it was waiting for the debugger to close, and force closing the app didn't generate the CSS.
from babel-plugin-css-modules-transform.
Hm. I wasn't using --inspect
, just not seeing any generated output.
from babel-plugin-css-modules-transform.
With the setup we have, I noticed that //
styled comments in SCSS files will somehow break the plugin and cause an empty styles
object.
from babel-plugin-css-modules-transform.
Related Issues (20)
- Relative urls are not resolved in extracted css
- dont work for css-loader@^2 HOT 3
- preprocessor errors and missing files are swallowed
- Rebuild extracted CSS file on original css file change (using parceljs instead of webpack)
- using babel-plugin-css-modules-transform with ssr not working HOT 2
- minimist vulnerability in 1.6.2 HOT 1
- Problems on Windows machines HOT 2
- Doesn't work with @babel/register, works only with @babel/cli
- It is not wroking with aliasing css HOT 1
- Better alternative
- Some local test cases fail
- "in" operator fails upon use of "resolve" option
- transform with less HOT 1
- implicitly registeres node hook HOT 1
- import without assign are not processed
- import named className doesn't work HOT 3
- Unable to require/import images when using this plugin
- babel-plugin-css-modules-transform and css-loader create different class names HOT 3
- Using Node's require to resolve file path does not resolve correct library from node_modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-css-modules-transform.