Code Monkey home page Code Monkey logo

Comments (3)

SassNinja avatar SassNinja commented on July 25, 2024

@Alexandr-Lazariev I've updated the webpack example to use the latest version of postcss-loader.
It's still working afterwards.

However I'm using webpack 4, not 3.
Have you considered upgrading to 4?

from postcss-extract-media-query.

Alexandr-Lazariev avatar Alexandr-Lazariev commented on July 25, 2024

Hey, thanks for reply, actually my issue was related to incorrect path, instead of using 'dist' I should have used 'assets', as simple as that.

However, I'm still facing another issue, I have a lot of css files in my assets folder and I'm not sure how can I use entry and output setting to have multiple query files from multiple entries with different names

 entry: path.join(__dirname, outputPath + '/*.css'),
    output: {
        path: path.resolve(__dirname, outputPath),
        name: '[name]-[query].css'
    },
    queries: {
        'only screen and (min-width: 1025px)': 'desktop'
    },
    minimize: true,
    whitelist: true,
}

The output file name is: *-desktop.css
and I want to have:
global-desktop.css
specific-desktop.css

I guess the whole problem is
path.join(__dirname, outputPath + '/*.css')
But I'm not sure what should be here instead

from postcss-extract-media-query.

SassNinja avatar SassNinja commented on July 25, 2024

I guess the whole problem is
path.join(__dirname, outputPath + '/*.css')
But I'm not sure what should be here instead

yup, the problem is starting there

  1. I haven't implemented glob support and thus *.css is considered as one file
  2. the entry option is not built to support multiple entries but only one file, assuming the postcss plugin is executed per file (either manually or via bundler/task runner)

Please provide your webpack config & package.json so I can reproduce the issue.

from postcss-extract-media-query.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.