jednano / craco-linaria Goto Github PK
View Code? Open in Web Editor NEWA craco plugin to use Linaria zero-runtime CSS in JS library in a create react app.
License: MIT License
A craco plugin to use Linaria zero-runtime CSS in JS library in a create react app.
License: MIT License
Hello and thanks for this plugin!
In [email protected]
Jest fails to run because the babel transform is added instead of being overridden.
PR #22 fixes it.
Hi there,
Thank you for this plugin, it's really useful ๐
I was wondering, did you manage to get the source-maps to work?
The source-map is appended to the CSS file, but devtools doesn't recognize it.
I wonder if I did something wrong or maybe there is a bug?
I would appreciate you help (:
devtools, sourcemaps are not recognized
src/.linaria_cache/src/App.linaria.css
.Test_tm0as6w{font-size:3em;color:purple;}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9hZG1pbi9kZXYvbGluYS9zcmMvQXBwLmpzIl0sIm5hbWVzIjpbIi5UZXN0X3RtMGFzNnciXSwibWFwcGluZ3MiOiJBQUdNQSIsImZpbGUiOiIvVXNlcnMvYWRtaW4vZGV2L2xpbmEvc3JjL0FwcC5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsgc3R5bGVkIH0gZnJvbSAnbGluYXJpYS9yZWFjdCc7XG5cbmNvbnN0IFRlc3QgPSBzdHlsZWQuZGl2YFxuICBmb250LXNpemU6IDNlbTtcbiAgY29sb3I6IHB1cnBsZTtcbmA7XG5cbmZ1bmN0aW9uIEFwcCgpIHtcbiAgcmV0dXJuIChcbiAgICA8ZGl2IGNsYXNzTmFtZT1cIkFwcFwiPlxuICAgICAgPFRlc3Q+XG4gICAgICAgIFRlc3RcbiAgICAgIDwvVGVzdD5cbiAgICA8L2Rpdj5cbiAgKTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgQXBwO1xuIl19*/
craco.config.js
module.exports = {
plugins: [
{ plugin: require('craco-linaria') },
],
}
linaria.config.js
module.exports = {
displayName: true
}
Example Repo
https://github.com/asfktz/linaria-craco-no-sourcemap-demo
So in the transformBabelLoader
function, when linaria/babel
preset is pushed to the array it doesn't copy the rest of the options.
Should be { ...options, presets: presets.concat('linaria/babel') }
instead because the original config has options other than presets
Most importantly it has a plugin that allows imporing .svg
as ReactComponent
. Thus when craco-linaria
plugin is added you can no longer have this feature.
Also I'm a webpack noob tbh, so thank you so much for this plugin! :D
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.