Skip to content
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

Using with PostCSS #10

Closed
mttmccb opened this issue Oct 31, 2016 · 3 comments
Closed

Using with PostCSS #10

mttmccb opened this issue Oct 31, 2016 · 3 comments

Comments

@mttmccb
Copy link

mttmccb commented Oct 31, 2016

I've configured an additional loader but it's not working as expected... I've started with skeleton-typescript-webpack

and update the css config as per below

      require('@easy-webpack/config-css')
        ({ filename: 'styles.css', allChunks: true, sourceMap: false, additionalLoaders: ['postcss'] }),
      {
        postcss: [
            smartImport,
            cssnext({
              features: {
                customProperties: {
                  preserve: false
                }
              }
            }),
            cssnano({
              reduceIdents: false
            }),
            reporter,
          ]
      },

But it doesn't seem to be processing any of the files I've required into my components. It's just picking up the 'styles.css' and doing the necessary processing for that.

Any ideas on where to start, I'm not sure if it's a loader issue or some other config with easy-webpack.

EDIT

Seems that switching from require to import has resolved the issue, it's now being processed by webpack correctly. Why wouldn't require do this?

@niieani
Copy link
Contributor

niieani commented Nov 1, 2016

Can you be more specific as to: "Seems that switching from require to import"?
Where did you make the switch?

@mttmccb
Copy link
Author

mttmccb commented Nov 1, 2016

sorry I wasn't clear. In my View I was including the CSS like this

<template>
  <require from='./my-component.css'></require>
  ...

So I removed it and in the ViewModel I included it like this instead

import './my-component.css';

export class MyComponent {
   ...

Webpack wasn't processing the file otherwise.

@mttmccb
Copy link
Author

mttmccb commented Nov 9, 2016

Just trying this with the updated skeleton and can't figure out how to pass the settings, I can set the additionalLoaders ok...

  css({ filename: 'styles.css', allChunks: true, sourceMap: false, additionalLoaders: ['postcss']}),

@mttmccb mttmccb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants