TrySound / postcss-easy-import

PostCSS plugin to inline @import rules content with extra features
MIT License
201 stars 25 forks source link

Resolving webpack aliases #12

Closed Tux1 closed 7 years ago

Tux1 commented 7 years ago

Hi,

I cannot resolve scss file with webpack alias. is it a normal behavior ?

I get this error :

WARNING in ./~/css-loader?{"sourceMap":true,"modules":true,"localIdentName":"[name][local][hash:base64:3]","minimize":false}!./~/postcss-loader!./components/UserPage/styles.scss postcss-import: /Users/toto/web/components/UserPage/styles.scss:1:1: Cannot find module 'scss/main.scss' from '/Users/toto/web/components/UserPage'

styles.css contains : @import "scss/main.scss and below is the function I use in my webpack config:

  postcss(bundler) {
    return {
      plugins: [
        require('postcss-easy-import')({
          addDependencyTo: bundler,
          // path: path.resolve(__dirname, 'assets/scss'),
        }),
        require('autoprefixer')(),
      ],
      syntax,
      parser: syntax,
    };
simonsmith commented 7 years ago

Hi @Tux1,

Do you think you could update this issue with a full webpack config that reproduces the issue? I think the latest version of postcss-import resolved some webpack issues but it'd be nice to have a test case.

Thanks

Tux1 commented 7 years ago

Hi Simon, Will test asap Thanks !

Sent from my iPhone

On 9 Dec 2016, at 07:18, Simon Smith notifications@github.com wrote:

Hi @Tux1,

Do you think you could update this issue with a full webpack config that reproduces the issue? I think the latest version of postcss-import resolved some webpack issues but it'd be nice to have a test case.

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

simonsmith commented 7 years ago

Just published 2.0.0. It now uses postcss-import 9.x which did resolve some webpack issues. Please let me know if you have further problems related to this plugin and we can reopen.