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

Without from option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to undefined to prevent this warning. #2

Closed
bahador opened this issue Apr 5, 2018 · 8 comments

Comments

@bahador
Copy link

bahador commented Apr 5, 2018

I get the following error when running rollup:
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.

here's the svelte config in rollup.config.js:

    svelte({
      css: function (css) {
        css.write(`public/build/styles.${hash}.css`, !production)
      },
      hydratable: true,
      preprocess: {
        style: sveltePreprocessPostcss({
          configFilePath: '',
          useConfigFile: true,
          plugins: []
        })
      }
    })

and here's my postcss.config.js:

module.exports = {
  from: undefined,
  plugins: []
}

i can fix this if i edit this line: https://github.com/TehShrike/svelte-preprocess-postcss/blob/master/index.js#L20
to be this:
.process(css, { from: undefined })

but this is probably wrong...

@TehShrike
Copy link
Owner

Thanks for raising this issue - I've just been ignoring that (it's just a warning, not an error).

I haven't known what, if anything, it would make sense to set the from to :-x

So, it's probably fine to set it to undefined just to make the warning go away?

@bahador
Copy link
Author

bahador commented Apr 6, 2018

i'm not sure, to be honest. i'd try false and go with that if it worked.

@dalisoft
Copy link

dalisoft commented May 6, 2019

Same issue for me

@yaliv
Copy link

yaliv commented Jun 9, 2019

Please... 🔨 it.

@TehShrike
Copy link
Owner

Has anyone tested an alternative?

@TehShrike
Copy link
Owner

Pull requests are welcome

@yaliv
Copy link

yaliv commented Jun 9, 2019

Setting from: undefined in postcss.config.js has no effect here.

And at least I've tried codes from this PR for the from config to work. So I think it's good to merge that one.

@TehShrike
Copy link
Owner

Published as 1.1.0 – let me know if there are any issues.

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

4 participants