-
-
Notifications
You must be signed in to change notification settings - Fork 210
[2.0.5] css-loader: modules
not working as needed after upgrade
#232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Maybe because you are setting |
Which CSS is missing (from |
Maybe releated to #222 (needs more info) |
css modules from src are not in css bundle.
I was thinking same but how could I do same without context option? |
...
plugins: (loader) => { loader.context } // it should be there already
... What it's purpose atm? I couldn't really reason about, where it actually gets used? :) |
css-loader: modules
not working as needed after upgrade
Hi! I did not investigate too deep, but after upgrade from 1.x to 2.0.5 version animations are broken in a project with I can confirm that it's exactly the upgrade of But seems like there are some improvements as well, since build is now way smaller (1.1 Mb with So I assume you optimized importing logic, but looks like optimizations were too hard =) It's a pity i cannot upgrade due to the mentioned issue. |
@olegstepura can your provide minimal reproducible test repo? |
@olegstepura I need your more info on how you utilise the lib (source files, |
Hi, @michael-ciniawsky! Thanks for your response. Here are my config files: gist In @evilebottnawi I will try to prepare test repo. |
Here is my test repo with react-toolbox: olegstepura/postcss-loader-test The only change between two versions below is an edit in - "postcss-loader": "^1.3.3",
+ "postcss-loader": "^2.0.5", And run With version
|
Also I would love to hear any suggestion on how to remove source maps from // ..
{"
.M7gDzYJNjHIL0YutSEctg :before{-webkit-touch-callout:none}._3pcMeyQKXVxkWHxAmg7hCU{background:rgba(97,97,97,.9);border-radius:2px;color:#fff;display:block;padding:8px}",
"",
{version:3,
sources:["c:/Temp/test/postcss-loader-test/node_modules/react-toolbox/lib/tooltip/theme.css"],
names:[],
mappings:"AAAA,+CACI,0DAA2D,AACnD,kDAAmD,AAE3D,0BACE,0DAA2D,AACnD,iDAAmD,CAC5D,CACJ,AAED,+CACI,8DAA+D,AACvD,sDAAuD,AAE/D,0BACE,8DAA+D,AACvD,qDAAuD,CAChE,CACJ,AAED,6CACI,8DAA+D,AACvD,sDAAuD,AAE/D,0BACE,8DAA+D,AACvD,qDAAuD,CAChE,CACJ,AAED,+CACI,4CAA6C,AACrC,mCAAqC,CAChD,uBACC,cAAe,AAEf,eAAgB,AAChB,gBAAiB,AACjB,iBAAkB,AAClB,gBAAiB,AACjB,YAAa,AACb,oBAAqB,AACrB,kBAAmB,AACnB,kBAAmB,AACnB,oBAAqB,AACrB,4CAA6C,AACrC,oCAAqC,AAC7C,kCAAmC,AAC3B,0BAA2B,AACnC,iDAAyD,AACzD,YAAa,AAEX,6CAAwD,CAM3D,AAED,6GATI,sBAAuB,AAEvB,mCAAoC,AACpC,2BAA4B,AAC5B,8BAA+B,AAC3B,0BAA2B,AACvB,qBAAsB,CAajC,AAVD,sFASM,0BAA4B,CACjC,AACD,yBACE,6BAAkC,AAClC,kBAAmB,AACnB,WAA0B,AAC1B,cAAe,AACf,WAAa,CACd",
file:"theme.css",
sourcesContent:[".tooltip.tooltipRight {\n -webkit-transform: scale(0) translateX(0) translateY(-50%);\n transform: scale(0) translateX(0) translateY(-50%);\n\n &.tooltipActive {\n -webkit-transform: scale(1) translateX(0) translateY(-50%);\n transform: scale(1) translateX(0) translateY(-50%);\n }\n}\n\n.tooltip.tooltipLeft {\n -webkit-transform: scale(0) translateX(-100%) translateY(-50%);\n transform: scale(0) translateX(-100%) translateY(-50%);\n\n &.tooltipActive {\n -webkit-transform: scale(1) translateX(-100%) translateY(-50%);\n transform: scale(1) translateX(-100%) translateY(-50%);\n }\n}\n\n.tooltip.tooltipTop {\n -webkit-transform: scale(0) translateX(-50%) translateY(-100%);\n transform: scale(0) translateX(-50%) translateY(-100%);\n\n &.tooltipActive {\n -webkit-transform: scale(1) translateX(-50%) translateY(-100%);\n "
]}
// ... this clearly states that there are source maps inside, which just make build heavier. I'm not even sure if this can somehow help debugging |
@olegstepura without minimal repo we can't do anything, seems your use |
@olegstepura oh, sorry don't saw your test repo 😄 let's see what is wrong |
{
loader: 'postcss-loader',
options: {
sourceMap: false
}
} Please, use the search before writing about the problem. Thanks! |
@carlitux See #222 (comment), but feel free to reopen if still regressions @olegstepura See @evilebottnawi comments, the only Please update webpack |
@evilebottnawi, @michael-ciniawsky thanks. I used search, that was how I found this issue not opened by me.
So the animation problems are related to this as well, right? |
About sourceMaps: Sourcemaps stuff is complex, sorry to bother you. Use case 1: I do not want source maps for CSS
Ok, maybe some PostCSS config should be added.
Use case 2: I want source maps to be stored in separate
|
devtool: 'sourcemap',
output: {
filename: '[name].js',
sourceMapFilename: '[name].js.map'
} |
@michael-ciniawsky This is exactly (except of |
My CSS Modules also stopped working with css-loader 2.x. Heres my webpack config: import path from 'path'
import fs from 'fs'
const externals = fs.readdirSync('node_modules')
.filter((file) => !file.includes('.bin'))
.map((name) => ({ [name]: `commonjs ${name}` }))
.reduce((prev, curr) => ({ ...prev, ...curr }))
const defaultConfig = {
context: path.resolve(__dirname, '..'),
entry: './src/server',
externals,
node: {
__dirname: true,
},
target: 'node',
output: {
path: path.resolve(__dirname, '..', 'dist'),
filename: 'server.js',
},
module: {
rules: [
{
test: /\.js$/,
use: [{
loader: 'babel-loader',
}],
exclude: [
path.resolve(__dirname, 'node_modules'),
],
},
{
test: /\.css$/,
use: ExtractTextWebpackPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
query: {
modules: true,
importLoaders: 1,
localIdentName: '[local]-[hash:base64:5]',
},
},
{
loader: 'postcss-loader',
},
],
}),
},
],
},
plugins: [
new ExtractTextWebpackPlugin({
filename: 'styles.css',
ignoreOrder: true,
}),
],
devtool: 'cheap-module-eval-source-map',
}
export default defaultConfig Any idea why this happens? |
@felixsanz Why do you duplicate it? It is create noise, just wait for someone to get free, also you can try to find the problem yourself and describe where it was found it will speed up the solution |
@evilebottnawi I'm not duplicating anything, i just moved my conversation here to avoid polluting the other issue :/ Notice that i deleted my message from the other issue. Sorry if it triggered notfiications |
@felixsanz It would also be nice to see minimal test reproducible repo, it is difficult say that it is wrong just the configuration |
@felixsanz just create new issue with minimal repo and what your expected and actually output. Please don't write your problems in closed issue |
@evilebottnawi I tried to create one reproducible test case but i don't even know what i'm supposed to reproduce. I don't understand whats going on, i just see that many rules just dissappeared while others are just there. Open it then please? It's clearly not fixed |
@felixsanz yep create new issue and try to show what is wrong (screenshots, console, example of code and etc.). Don't write here otherwise the problem may not be noticed. |
@felixsanz The only obvious thing I can see is (but likely unrelated) {
loader: 'css-loader',
- query: {
+ options: {
modules: true,
importLoaders: 1,
localIdentName: '[local]-[hash:base64:5]',
},
} What how does your current |
Your postcss plugin versions |
@michael-ciniawsky It was working fine with 1.3.3. So the bug was introduced with postcss-loader 2.x, directly or indirectly. My
|
The version of |
Please also provide an input -> output example |
I'll try create a testcase, but I spent an hour before with no success. I'll try again tomorrow. |
@evilebottnawi, @michael-ciniawsky please let me know if you will answer anything to my sourcemap issue. If I should create a new separate issue, I will. If you think this is not anyhow related to |
@olegstepura yep, create new issue with repo and description problem, otherwise we can lose it here. Thanks! |
css modules inside node_modules are working but css modules on my source are not added but loaded.
css is missed
The text was updated successfully, but these errors were encountered: