Comments (1)
Hi,
Thanks for the feedback.
Are you able to provided an example webpack config showing how you use css-loader
and postcss
with css modules as I have not used this combination before. (I will update the following example once I have that example)
Possible solution:
Have you tried running two instances of the postcss-loader
as I have tested that Webpack is perfectly happy with doing this.
The following example is using style-loader
which is loading just some standard css (not using css modules):
/src/bundle.js
import "./css/apple.css";
/src/css/apple.css
body {
background: rgba(153, 221, 153, 0.8);
}
<html>
<head>
<script src="./out/bundle.js"></script>
</head>
<body>
<div class="my-custom-wrap">
<p>Hello World</p>
</div>
</body>
</html>
/webpack.config.js
module.exports = {
entry: "./src/bundle.js",
output: {
path: `${__dirname}/out`,
filename: "bundle.js"
},
module: {
rules: [{
test: /\.css/,
loaders: [
"style-loader",
{
loader: "postcss-loader",
options: {
plugins: [
require("postcss-color-rgba-fallback")()
]
},
},
// css-loader or other loaders could be run here.
{
loader: "postcss-loader",
options: {
plugins: [
require("postcss-prefixwrap")(".my-custom-wrap")
]
},
},
],
include: `${__dirname}/src/css`
}]
}
};
When I use this config, I see the Hello World text on a green background using the hex representation of the colour. This shows that both postcss-loader instances ran successfully.
Hope this helps.
from postcss-prefixwrap.
Related Issues (20)
- postcss.plugins was deprecated HOT 3
- Can't install without peer dependency errors HOT 2
- The name of the latest release should be 1.26.0 but is 1.16.0 HOT 1
- Error: PostCSS plugin postcss-prefixwrap requires PostCSS 8. HOT 5
- Rule not wrapped when the first selector starts with the prefix HOT 4
- PostCSS plugin postcss-prefixwrap requires PostCSS 8 HOT 1
- Issues with combination of postcss-nested HOT 3
- Handling of root elements HOT 1
- Add ability to replace the :root pseudo-class directly or through generic addition HOT 3
- Why add every className? HOT 5
- how to use in webpack5? HOT 1
- Using "/" path separator in "whitelist", "blacklist" config doesn't work in windows env HOT 1
- Version 1.35.0 not working HOT 2
- Integration Test Rethink
- Cannot compile with `tsc` (was: "1.34.0 -> 1.35.1 broke the types") HOT 4
- Use Modern JS (ES6+)
- Ensure Testing with Current Node Versions
- [Feature request] Add support for compound selector HOT 3
- Provenance HOT 2
- bug: `dist/main.js` missing in published package since 1.8.0 HOT 2
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 postcss-prefixwrap.